From: Mircea Kitsune Date: Fri, 21 Jan 2011 02:39:49 +0000 (+0200) Subject: Fix weapons with reloading disabled X-Git-Tag: xonotic-v0.5.0~309^2~7^2~167 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4db4ab489d31ad4c7bc5998853c2ffbcf25df076;p=xonotic%2Fxonotic-data.pk3dir.git Fix weapons with reloading disabled --- diff --git a/qcsrc/server/w_shotgun.qc b/qcsrc/server/w_shotgun.qc index a99786ae3..6f0705471 100644 --- a/qcsrc/server/w_shotgun.qc +++ b/qcsrc/server/w_shotgun.qc @@ -66,7 +66,7 @@ void W_Shotgun_Attack (void) float bulletconstant; local entity flash; - if(self.ammo_counter <= 0) + if(autocvar_g_balance_shotgun_reload_ammo && self.ammo_counter <= 0) return; // reloading, so we are done ammoamount = autocvar_g_balance_shotgun_primary_ammo; @@ -170,7 +170,7 @@ float w_shotgun(float req) self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE); else if (req == WR_THINK) { - if(self.ammo_counter <= 0) // forced reload + if(autocvar_g_balance_shotgun_reload_ammo && self.ammo_counter <= 0) // forced reload W_Shotgun_Reload(); else { diff --git a/qcsrc/server/w_sniperrifle.qc b/qcsrc/server/w_sniperrifle.qc index c4d273c82..0938cae0a 100644 --- a/qcsrc/server/w_sniperrifle.qc +++ b/qcsrc/server/w_sniperrifle.qc @@ -135,8 +135,10 @@ void spawnfunc_weapon_campingrifle (void) void W_SniperRifle_BulletHail_Continue() { float r, sw, af; - if(self.ammo_counter <= 0) + + if(autocvar_g_balance_sniperrifle_reload_ammo && self.ammo_counter <= 0) return; // reloading, so we are done + sw = self.switchweapon; // make it not detect weapon changes as reason to abort firing af = ATTACK_FINISHED(self); self.switchweapon = self.weapon; @@ -208,7 +210,7 @@ float w_sniperrifle(float req) else if (req == WR_THINK) { W_SniperRifle_SetAmmoCounter(); - if(self.ammo_counter <= 0) // forced reload + if(autocvar_g_balance_sniperrifle_reload_ammo && self.ammo_counter <= 0) // forced reload W_SniperRifle_Reload(); else {