Obey refire delay in offhand hook mode
authorMario <mario.mario@y7mail.com>
Tue, 7 Jan 2014 13:01:01 +0000 (00:01 +1100)
committerMario <mario.mario@y7mail.com>
Tue, 7 Jan 2014 13:01:01 +0000 (00:01 +1100)
qcsrc/server/g_hook.qc

index 0df6ba0..b7828e5 100644 (file)
@@ -383,7 +383,7 @@ void GrapplingHookFrame()
                // offhand hook controls
                if(self.BUTTON_HOOK)
                {
-                       if (!(self.hook || (self.hook_state & HOOK_WAITING_FOR_RELEASE)))
+                       if (!(self.hook || (self.hook_state & HOOK_WAITING_FOR_RELEASE)) && (time > self.hook_refire))
                        {
                                self.hook_state |= HOOK_FIRING;
                                self.hook_state |= HOOK_WAITING_FOR_RELEASE;
@@ -426,6 +426,7 @@ void GrapplingHookFrame()
                        RemoveGrapplingHook(self);
                FireGrapplingHook();
                self.hook_state &= ~HOOK_FIRING;
+               self.hook_refire = max(self.hook_refire, time + autocvar_g_balance_hook_primary_refire * W_WeaponRateFactor());
        }
        else if(self.hook_state & HOOK_REMOVING)
        {