From: terencehill Date: Fri, 15 Feb 2013 19:37:40 +0000 (+0100) Subject: Correctly block weapon functionalities in the other situations too X-Git-Tag: xonotic-v0.7.0~61^2~43 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=fc12fff92661d22ac4d9478424c5f8c3f795c6fa;p=xonotic%2Fxonotic-data.pk3dir.git Correctly block weapon functionalities in the other situations too --- diff --git a/qcsrc/server/cl_weapons.qc b/qcsrc/server/cl_weapons.qc index 7e9da5b21..2715d475c 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;