From: Rudolf Polzer Date: Mon, 22 Aug 2011 19:42:02 +0000 (+0200) Subject: try preventing weapon switching a more sensible way. Should work well with NIX that... X-Git-Tag: xonotic-v0.5.0~74^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=dbbfd3ab5df0a1105fad82eced8c3da5eb5110d2;p=xonotic%2Fxonotic-data.pk3dir.git try preventing weapon switching a more sensible way. Should work well with NIX that way. --- diff --git a/qcsrc/server/w_hagar.qc b/qcsrc/server/w_hagar.qc index adfd15de8..a27bdac8f 100644 --- a/qcsrc/server/w_hagar.qc +++ b/qcsrc/server/w_hagar.qc @@ -242,17 +242,20 @@ void W_Hagar_Attack2_Load (void) if(self.hagar_load) { + self.weaponentity.state = WS_INUSE; // prevents weapon switching if(!self.BUTTON_ATCK2 || ((loaded || !enough_ammo) && self.hagar_loadstep < time && !autocvar_g_balance_hagar_secondary_load_hold)) W_Hagar_Attack2_Load_Release(); } else { + self.weaponentity.state = WS_READY; // allows weapon switching self.hagar_loadbeep = FALSE; } // we aren't checking ammo during an attack, so we must do it here if not(weapon_action(self.weapon, WR_CHECKAMMO1) + weapon_action(self.weapon, WR_CHECKAMMO2)) { + // note: this doesn't force the switch W_SwitchToOtherWeapon(self); return; }