]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Only use wish_reload where we have to
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 21 Jan 2011 02:18:49 +0000 (04:18 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 21 Jan 2011 02:18:49 +0000 (04:18 +0200)
qcsrc/server/cl_client.qc
qcsrc/server/w_shotgun.qc
qcsrc/server/w_sniperrifle.qc

index 36c23473202d47d7f2e094103b0fccda9bfd3e5d..796f0dc35252bba3ee98ce599d11b9e617f591b8 100644 (file)
@@ -1065,8 +1065,6 @@ void PutClientInServer (void)
                self.cnt = self.switchweapon;
                self.weapon = 0;
 
-        self.wish_reload = 0;
-
                if(!self.alivetime)
                        self.alivetime = time;
        } else if(self.classname == "observer" || (g_ca && !allowed_to_spawn)) {
index 7d0c27c822f0967948510b448ab4951692b27618..1d4db80554b5037c67463b4df9c92a4bed2b1f03 100644 (file)
@@ -66,10 +66,7 @@ void W_Shotgun_Attack (void)
        local entity flash;
 
        if(self.ammo_counter <= 0)
-       {
-               W_Shotgun_Reload();
                return; // reloading, so we are done
-       }
 
        ammoamount = autocvar_g_balance_shotgun_primary_ammo;
        bullets = autocvar_g_balance_shotgun_primary_bullets;
@@ -173,7 +170,7 @@ float w_shotgun(float req)
        else if (req == WR_THINK)
        {
                if(self.ammo_counter < 0) // forced reload (e.g. because interrupted)
-            self.wish_reload = 1;
+                       W_Shotgun_Reload();
                else
                {
                        if (self.BUTTON_ATCK)
index 2dc560dc96eae5adadf7195e3b51d117e162ff42..fbee51a97c5cfb4d373705454edba1e3917fb50e 100644 (file)
@@ -135,10 +135,7 @@ void W_SniperRifle_BulletHail_Continue()
 {
        float r, sw, af;
        if(self.ammo_counter <= 0)
-       {
-               W_SniperRifle_Reload();
                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;
@@ -211,7 +208,7 @@ float w_sniperrifle(float req)
        {
                W_SniperRifle_SetAmmoCounter();
                if(self.ammo_counter < 0) // forced reload (e.g. because interrupted)
-            self.wish_reload = 1;
+            W_SniperRifle_Reload();
                else
                {
                        self.sniperrifle_accumulator = bound(time - autocvar_g_balance_sniperrifle_bursttime, self.sniperrifle_accumulator, time);
@@ -228,7 +225,7 @@ float w_sniperrifle(float req)
                                if (autocvar_g_balance_sniperrifle_secondary)
                                {
                     if(autocvar_g_balance_sniperrifle_secondary_reload)
-                        self.wish_reload = 1;
+                        W_SniperRifle_Reload();
                     else
                     {
                         if (weapon_prepareattack_check(1, autocvar_g_balance_sniperrifle_secondary_refire))
@@ -278,7 +275,7 @@ float w_sniperrifle(float req)
                return self.ammo_nails >= autocvar_g_balance_sniperrifle_secondary_ammo;
        else if (req == WR_RELOAD)
        {
-        self.wish_reload = 1;
+               W_SniperRifle_Reload();
        }
        else if (req == WR_RESETPLAYER)
        {