From fc12fff92661d22ac4d9478424c5f8c3f795c6fa Mon Sep 17 00:00:00 2001 From: terencehill Date: Fri, 15 Feb 2013 20:37:40 +0100 Subject: [PATCH] Correctly block weapon functionalities in the other situations too --- qcsrc/server/cl_weapons.qc | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/qcsrc/server/cl_weapons.qc b/qcsrc/server/cl_weapons.qc index 7e9da5b212..2715d475c8 100644 --- a/qcsrc/server/cl_weapons.qc +++ b/qcsrc/server/cl_weapons.qc @@ -365,7 +365,19 @@ void W_ThrowWeapon(vector velo, vector delta, float doreduce) sprint(self, strcat("You dropped the ^2", W_Name(w), " with ", a, "\n")); } -// Bringed back weapon frame +float forbidWeaponUse() +{ + if(time < game_starttime && !autocvar_sv_ready_restart_after_countdown) + return 1; + if(round_handler_IsActive() && !round_handler_IsRoundStarted()) + return 1; + if(self.player_blocked) + return 1; + if(self.freezetag_frozen) + return 1; + return 0; +} + void W_WeaponFrame() { vector fo, ri, up; @@ -376,22 +388,13 @@ void W_WeaponFrame() if (!self.weaponentity || self.health < 1) return; // Dead player can't use weapons and injure impulse commands - if(time < game_starttime && !autocvar_sv_ready_restart_after_countdown) - return; - - if(round_handler_IsActive() && !round_handler_IsRoundStarted()) + if(forbidWeaponUse()) if(self.weaponentity.state != WS_CLEAR) { w_ready(); return; } - if(self.player_blocked) - return; - - if(self.freezetag_frozen == 1) - return; - if(!self.switchweapon) { self.weapon = 0; -- 2.39.2