]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix weapons with reloading disabled
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 21 Jan 2011 02:39:49 +0000 (04:39 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 21 Jan 2011 02:39:49 +0000 (04:39 +0200)
qcsrc/server/w_shotgun.qc
qcsrc/server/w_sniperrifle.qc

index a99786ae3ca1e7390bd4e68cc85c7e90dbefdee9..6f070547193ac6abc2f26fbee83365a0750d835a 100644 (file)
@@ -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
                {
index c4d273c82900b996e10b59228c682deab9de1850..0938cae0a649e6cd32d0ce98c63b32fd857770e0 100644 (file)
@@ -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
                {