Merge branch 'master' into samual/weapons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_hook.qc
index 7b0648f..90b91ad 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_grapplehook_refire * W_WeaponRateFactor());
        }
        else if(self.hook_state & HOOK_REMOVING)
        {