From: Rudolf Polzer Date: Sun, 27 Mar 2011 05:32:42 +0000 (+0200) Subject: move the minstanex_ammo hack out of WR_THINK, as now multiple WR_s may use it, even... X-Git-Tag: xonotic-v0.5.0~305^2~22 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ef95da81bce164492f4a9ccef8cf3b45e9423a53;p=xonotic%2Fxonotic-data.pk3dir.git move the minstanex_ammo hack out of WR_THINK, as now multiple WR_s may use it, even before WR_THINK is called --- diff --git a/qcsrc/server/w_minstanex.qc b/qcsrc/server/w_minstanex.qc index 8977b67fd..4481178de 100644 --- a/qcsrc/server/w_minstanex.qc +++ b/qcsrc/server/w_minstanex.qc @@ -169,10 +169,17 @@ void minstagib_ammocheck (void) void spawnfunc_weapon_minstanex (void); // defined in t_items.qc -float minstanex_ammo; float w_minstanex(float req) { float ammo_amount; + float minstanex_ammo; + + // now multiple WR_s use this + if(g_minstagib) + minstanex_ammo = 1; + else + minstanex_ammo = autocvar_g_balance_minstanex_ammo; + if (req == WR_AIM) { if(self.ammo_cells > 0) @@ -182,11 +189,6 @@ float w_minstanex(float req) } else if (req == WR_THINK) { - if(g_minstagib) - minstanex_ammo = 1; - else - minstanex_ammo = autocvar_g_balance_minstanex_ammo; - // if the laser uses load, we also consider its ammo for reloading if(autocvar_g_balance_minstanex_reload_ammo && autocvar_g_balance_minstanex_laser_ammo && self.clip_load < min(minstanex_ammo, autocvar_g_balance_minstanex_laser_ammo)) // forced reload weapon_action(self.weapon, WR_RELOAD);