]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Rename another float
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 21 Jan 2011 17:56:49 +0000 (19:56 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 21 Jan 2011 17:56:49 +0000 (19:56 +0200)
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/defs.qh
qcsrc/server/g_world.qc
qcsrc/server/w_shotgun.qc
qcsrc/server/w_sniperrifle.qc

index 7f9707870016b7227e6909a6fddf3b90f0cc41b1..0c3100a45e8770717d150cfd6fe413893f943fbb 100644 (file)
@@ -1634,7 +1634,7 @@ float W_ReloadCheck(float ammo_amount)
        e = get_weaponinfo(self.weapon);
 
        // our weapon is fully loaded, no need to reload
-       if (self.ammo_counter >= cvar(strcat("g_balance_", e.netname, "_reload_ammo")))
+       if (self.ammo_loaded >= cvar(strcat("g_balance_", e.netname, "_reload_ammo")))
                return 0;
 
        // no ammo, so nothing to load
@@ -1647,9 +1647,9 @@ float W_ReloadCheck(float ammo_amount)
                        self.reload_complain = time + 1;
                }
                // is there's no more ammo to reload, only switch to another weapon if there's no more load in this one
-               if(!self.ammo_counter)
+               if(!self.ammo_loaded)
                {
-                       self.ammo_counter = -1; // reload later
+                       self.ammo_loaded = -1; // reload later
                        W_SwitchToOtherWeapon(self);
                }
                return 0;
index 691df58851a5e9affff04431d3137213f003ce73..56e24ce86984aefb538331bf7e959bda4c4ada5c 100644 (file)
@@ -612,8 +612,8 @@ float client_cefc_accumulator;
 float client_cefc_accumulatortime;
 #endif
 
-.float ammo_counter;
-.float old_ammo_counter;
+.float ammo_loaded;
+.float old_ammo_loaded;
 .float ammo_max;
 .float wish_reload;
 
index 1460ac7c34201151b6aa97cfb64e465f9df9746a..00a87c520245e9b6b01928b11aa3314cf695c6d0 100644 (file)
@@ -818,7 +818,7 @@ void spawnfunc_worldspawn (void)
        addstat(STAT_FUEL, AS_INT, ammo_fuel);
        addstat(STAT_SHOTORG, AS_INT, stat_shotorg);
        addstat(STAT_LEADLIMIT, AS_FLOAT, stat_leadlimit);
-       addstat(STAT_WEAPON_LOAD, AS_INT, ammo_counter);
+       addstat(STAT_WEAPON_LOAD, AS_INT, ammo_loaded);
        addstat(STAT_WEAPON_CLIPSIZE, AS_INT, ammo_max);
        addstat(STAT_LAST_PICKUP, AS_FLOAT, last_pickup);
 
index bf742871a6003a2553398cc2339f5a253d883024..3d2357e17ade19849bb6b7719baa8bf78f49b5c2 100644 (file)
@@ -7,12 +7,12 @@ REGISTER_WEAPON(SHOTGUN, w_shotgun, IT_SHELLS, 2, WEP_FLAG_NORMAL | WEP_TYPE_HIT
 
 void W_Shotgun_SetAmmoCounter()
 {
-       // set ammo_counter to the weapon we have switched to, if the gun uses reloading
+       // set ammo_loaded to the weapon we have switched to, if the gun uses reloading
        if(!autocvar_g_balance_shotgun_reload_ammo)
-               self.ammo_counter = 0; // also keeps crosshair ammo from displaying
+               self.ammo_loaded = 0; // also keeps crosshair ammo from displaying
        else
        {
-               self.ammo_counter = self.shotgun_load;
+               self.ammo_loaded = self.shotgun_load;
                self.ammo_max = autocvar_g_balance_shotgun_reload_ammo; // for the crosshair ammo display
        }
 }
@@ -22,13 +22,13 @@ void W_Shotgun_ReloadedAndReady()
        float t;
 
        // now do the ammo transfer
-       self.ammo_counter = self.old_ammo_counter; // restore the ammo counter, in case we still had ammo in the weapon before reloading
-       while(self.ammo_counter < autocvar_g_balance_shotgun_reload_ammo && self.ammo_shells) // make sure we don't add more ammo than we have
+       self.ammo_loaded = self.old_ammo_loaded; // restore the ammo counter, in case we still had ammo in the weapon before reloading
+       while(self.ammo_loaded < autocvar_g_balance_shotgun_reload_ammo && self.ammo_shells) // make sure we don't add more ammo than we have
        {
-               self.ammo_counter += 1;
+               self.ammo_loaded += 1;
                self.ammo_shells -= 1;
        }
-       self.shotgun_load = self.ammo_counter;
+       self.shotgun_load = self.ammo_loaded;
 
        t = ATTACK_FINISHED(self) - autocvar_g_balance_shotgun_reload_time - 1;
        ATTACK_FINISHED(self) = t;
@@ -53,8 +53,8 @@ void W_Shotgun_Reload()
 
        weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_shotgun_reload_time, W_Shotgun_ReloadedAndReady);
 
-       self.old_ammo_counter = self.ammo_counter;
-       self.ammo_counter = -1;
+       self.old_ammo_loaded = self.ammo_loaded;
+       self.ammo_loaded = -1;
 }
 
 void W_Shotgun_Attack (void)
@@ -69,7 +69,7 @@ void W_Shotgun_Attack (void)
        float   bulletconstant;
        local entity flash;
 
-       if(autocvar_g_balance_shotgun_reload_ammo && self.ammo_counter <= 0)
+       if(autocvar_g_balance_shotgun_reload_ammo && self.ammo_loaded <= 0)
                return; // reloading, so we are done
 
        ammoamount = autocvar_g_balance_shotgun_primary_ammo;
@@ -107,8 +107,8 @@ void W_Shotgun_Attack (void)
                        self.ammo_shells -= ammoamount;
                else
                {
-                       self.ammo_counter -= ammoamount;
-                       self.shotgun_load = self.ammo_counter;
+                       self.ammo_loaded -= ammoamount;
+                       self.shotgun_load = self.ammo_loaded;
                }
        }
 }
@@ -176,7 +176,7 @@ float w_shotgun(float req)
                        self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE);
        else if (req == WR_THINK)
        {
-               if(autocvar_g_balance_shotgun_reload_ammo && self.ammo_counter <= 0) // forced reload
+               if(autocvar_g_balance_shotgun_reload_ammo && self.ammo_loaded <= 0) // forced reload
                        W_Shotgun_Reload();
                else
                {
index e591a0076d3f94b2d4bf7da882c1b9c3972aa5e3..c6ffb02fbfd6f5bc8af3232daa4299e13f5658bd 100644 (file)
@@ -11,12 +11,12 @@ REGISTER_WEAPON(SNIPERRIFLE, w_sniperrifle, IT_NAILS, 7, WEP_FLAG_NORMAL | WEP_T
 
 void W_SniperRifle_SetAmmoCounter()
 {
-       // set ammo_counter to the weapon we have switched to, if the gun uses reloading
+       // set ammo_loaded to the weapon we have switched to, if the gun uses reloading
        if(!autocvar_g_balance_sniperrifle_reload_ammo)
-               self.ammo_counter = 0; // also keeps crosshair ammo from displaying
+               self.ammo_loaded = 0; // also keeps crosshair ammo from displaying
        else
        {
-               self.ammo_counter = self.sniperrifle_load;
+               self.ammo_loaded = self.sniperrifle_load;
                self.ammo_max = autocvar_g_balance_sniperrifle_reload_ammo; // for the crosshair ammo display
        }
 }
@@ -26,13 +26,13 @@ void W_SniperRifle_ReloadedAndReady()
        float t;
 
        // now do the ammo transfer
-       self.ammo_counter = self.old_ammo_counter; // restore the ammo counter, in case we still had ammo in the weapon before reloading
-       while(self.ammo_counter < autocvar_g_balance_sniperrifle_reload_ammo && self.ammo_nails) // make sure we don't add more ammo than we have
+       self.ammo_loaded = self.old_ammo_loaded; // restore the ammo counter, in case we still had ammo in the weapon before reloading
+       while(self.ammo_loaded < autocvar_g_balance_sniperrifle_reload_ammo && self.ammo_nails) // make sure we don't add more ammo than we have
        {
-               self.ammo_counter += 1;
+               self.ammo_loaded += 1;
                self.ammo_nails -= 1;
        }
-       self.sniperrifle_load = self.ammo_counter;
+       self.sniperrifle_load = self.ammo_loaded;
 
        t = ATTACK_FINISHED(self) - autocvar_g_balance_sniperrifle_reload_time - 1;
        ATTACK_FINISHED(self) = t;
@@ -57,8 +57,8 @@ void W_SniperRifle_Reload()
 
        weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_sniperrifle_reload_time, W_SniperRifle_ReloadedAndReady);
 
-       self.old_ammo_counter = self.ammo_counter;
-       self.ammo_counter = -1;
+       self.old_ammo_loaded = self.ammo_loaded;
+       self.ammo_loaded = -1;
 }
 
 void W_SniperRifle_FireBullet(float pSpread, float pDamage, float pHeadshotAddedDamage, float pForce, float pSpeed, float pLifetime, float pAmmo, float deathtype, float pBulletConstant)
@@ -92,8 +92,8 @@ void W_SniperRifle_FireBullet(float pSpread, float pDamage, float pHeadshotAdded
                        self.ammo_nails -= pAmmo;
                else
                {
-                       self.ammo_counter -= pAmmo;
-                       self.sniperrifle_load = self.ammo_counter;
+                       self.ammo_loaded -= pAmmo;
+                       self.sniperrifle_load = self.ammo_loaded;
                }
        }
 }
@@ -127,7 +127,7 @@ void W_SniperRifle_BulletHail_Continue()
 {
        float r, sw, af;
 
-       if(autocvar_g_balance_sniperrifle_reload_ammo && self.ammo_counter <= 0)
+       if(autocvar_g_balance_sniperrifle_reload_ammo && self.ammo_loaded <= 0)
                return; // reloading, so we are done
 
        sw = self.switchweapon; // make it not detect weapon changes as reason to abort firing
@@ -199,7 +199,7 @@ float w_sniperrifle(float req)
        }
        else if (req == WR_THINK)
        {
-               if(autocvar_g_balance_sniperrifle_reload_ammo && self.ammo_counter <= 0) // forced reload
+               if(autocvar_g_balance_sniperrifle_reload_ammo && self.ammo_loaded <= 0) // forced reload
             W_SniperRifle_Reload();
                else
                {
@@ -278,7 +278,7 @@ float w_sniperrifle(float req)
        else if (req == WR_RESETPLAYER)
        {
                self.sniperrifle_accumulator = time - autocvar_g_balance_sniperrifle_bursttime;
-               self.ammo_counter = autocvar_g_balance_sniperrifle_reload_ammo;
+               self.ammo_loaded = autocvar_g_balance_sniperrifle_reload_ammo;
        }
        return TRUE;
 };