From 8f61bbaf1956668b5d7cd64d038de1d1b632c220 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Fri, 21 Jan 2011 19:56:49 +0200 Subject: [PATCH] Rename another float --- qcsrc/server/cl_weaponsystem.qc | 6 +++--- qcsrc/server/defs.qh | 4 ++-- qcsrc/server/g_world.qc | 2 +- qcsrc/server/w_shotgun.qc | 26 +++++++++++++------------- qcsrc/server/w_sniperrifle.qc | 28 ++++++++++++++-------------- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/qcsrc/server/cl_weaponsystem.qc b/qcsrc/server/cl_weaponsystem.qc index 7f9707870..0c3100a45 100644 --- a/qcsrc/server/cl_weaponsystem.qc +++ b/qcsrc/server/cl_weaponsystem.qc @@ -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; diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 691df5885..56e24ce86 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -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; diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 1460ac7c3..00a87c520 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -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); diff --git a/qcsrc/server/w_shotgun.qc b/qcsrc/server/w_shotgun.qc index bf742871a..3d2357e17 100644 --- a/qcsrc/server/w_shotgun.qc +++ b/qcsrc/server/w_shotgun.qc @@ -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 { diff --git a/qcsrc/server/w_sniperrifle.qc b/qcsrc/server/w_sniperrifle.qc index e591a0076..c6ffb02fb 100644 --- a/qcsrc/server/w_sniperrifle.qc +++ b/qcsrc/server/w_sniperrifle.qc @@ -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; }; -- 2.39.2