]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Another rename
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 21 Jan 2011 18:14:45 +0000 (20:14 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 21 Jan 2011 18:14:45 +0000 (20:14 +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 0c3100a45e8770717d150cfd6fe413893f943fbb..badc34a8543e20dcbad6ca37769b70c94312534b 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_loaded >= cvar(strcat("g_balance_", e.netname, "_reload_ammo")))
+       if (self.clip_load >= 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_loaded)
+               if(!self.clip_load)
                {
-                       self.ammo_loaded = -1; // reload later
+                       self.clip_load = -1; // reload later
                        W_SwitchToOtherWeapon(self);
                }
                return 0;
index 56e24ce86984aefb538331bf7e959bda4c4ada5c..82b53fcad50720e74ab37ce83ad09bf9a15c5759 100644 (file)
@@ -612,9 +612,9 @@ float client_cefc_accumulator;
 float client_cefc_accumulatortime;
 #endif
 
-.float ammo_loaded;
-.float old_ammo_loaded;
-.float ammo_max;
+.float clip_load;
+.float old_clip_load;
+.float clip_size;
 .float wish_reload;
 
 #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_CORPSE; (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE
index 80b861b2f02de8727ea751e863a0a6a88c6a389a..9888fa5d52a34ba00365003f32f4134c235542c4 100644 (file)
@@ -818,8 +818,8 @@ 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_CLIPLOAD, AS_INT, ammo_loaded);
-       addstat(STAT_WEAPON_CLIPSIZE, AS_INT, ammo_max);
+       addstat(STAT_WEAPON_CLIPLOAD, AS_INT, clip_load);
+       addstat(STAT_WEAPON_CLIPSIZE, AS_INT, clip_size);
        addstat(STAT_LAST_PICKUP, AS_FLOAT, last_pickup);
 
        addstat(STAT_NEX_CHARGE, AS_FLOAT, nex_charge);
index 3d2357e17ade19849bb6b7719baa8bf78f49b5c2..4cfd5b4bd336af6d953dd28bdc21bb7036448801 100644 (file)
@@ -7,13 +7,13 @@ REGISTER_WEAPON(SHOTGUN, w_shotgun, IT_SHELLS, 2, WEP_FLAG_NORMAL | WEP_TYPE_HIT
 
 void W_Shotgun_SetAmmoCounter()
 {
-       // set ammo_loaded to the weapon we have switched to, if the gun uses reloading
+       // set clip_load to the weapon we have switched to, if the gun uses reloading
        if(!autocvar_g_balance_shotgun_reload_ammo)
-               self.ammo_loaded = 0; // also keeps crosshair ammo from displaying
+               self.clip_load = 0; // also keeps crosshair ammo from displaying
        else
        {
-               self.ammo_loaded = self.shotgun_load;
-               self.ammo_max = autocvar_g_balance_shotgun_reload_ammo; // for the crosshair ammo display
+               self.clip_load = self.shotgun_load;
+               self.clip_size = 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_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.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading
+       while(self.clip_load < autocvar_g_balance_shotgun_reload_ammo && self.ammo_shells) // make sure we don't add more ammo than we have
        {
-               self.ammo_loaded += 1;
+               self.clip_load += 1;
                self.ammo_shells -= 1;
        }
-       self.shotgun_load = self.ammo_loaded;
+       self.shotgun_load = self.clip_load;
 
        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_loaded = self.ammo_loaded;
-       self.ammo_loaded = -1;
+       self.old_clip_load = self.clip_load;
+       self.clip_load = -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_loaded <= 0)
+       if(autocvar_g_balance_shotgun_reload_ammo && self.clip_load <= 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_loaded -= ammoamount;
-                       self.shotgun_load = self.ammo_loaded;
+                       self.clip_load -= ammoamount;
+                       self.shotgun_load = self.clip_load;
                }
        }
 }
@@ -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_loaded <= 0) // forced reload
+               if(autocvar_g_balance_shotgun_reload_ammo && self.clip_load <= 0) // forced reload
                        W_Shotgun_Reload();
                else
                {
index c6ffb02fbfd6f5bc8af3232daa4299e13f5658bd..502fd3a53817e1a81d5dd132b5563fce87f36507 100644 (file)
@@ -11,13 +11,13 @@ REGISTER_WEAPON(SNIPERRIFLE, w_sniperrifle, IT_NAILS, 7, WEP_FLAG_NORMAL | WEP_T
 
 void W_SniperRifle_SetAmmoCounter()
 {
-       // set ammo_loaded to the weapon we have switched to, if the gun uses reloading
+       // set clip_load to the weapon we have switched to, if the gun uses reloading
        if(!autocvar_g_balance_sniperrifle_reload_ammo)
-               self.ammo_loaded = 0; // also keeps crosshair ammo from displaying
+               self.clip_load = 0; // also keeps crosshair ammo from displaying
        else
        {
-               self.ammo_loaded = self.sniperrifle_load;
-               self.ammo_max = autocvar_g_balance_sniperrifle_reload_ammo; // for the crosshair ammo display
+               self.clip_load = self.sniperrifle_load;
+               self.clip_size = 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_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.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading
+       while(self.clip_load < autocvar_g_balance_sniperrifle_reload_ammo && self.ammo_nails) // make sure we don't add more ammo than we have
        {
-               self.ammo_loaded += 1;
+               self.clip_load += 1;
                self.ammo_nails -= 1;
        }
-       self.sniperrifle_load = self.ammo_loaded;
+       self.sniperrifle_load = self.clip_load;
 
        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_loaded = self.ammo_loaded;
-       self.ammo_loaded = -1;
+       self.old_clip_load = self.clip_load;
+       self.clip_load = -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_loaded -= pAmmo;
-                       self.sniperrifle_load = self.ammo_loaded;
+                       self.clip_load -= pAmmo;
+                       self.sniperrifle_load = self.clip_load;
                }
        }
 }
@@ -127,7 +127,7 @@ void W_SniperRifle_BulletHail_Continue()
 {
        float r, sw, af;
 
-       if(autocvar_g_balance_sniperrifle_reload_ammo && self.ammo_loaded <= 0)
+       if(autocvar_g_balance_sniperrifle_reload_ammo && self.clip_load <= 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_loaded <= 0) // forced reload
+               if(autocvar_g_balance_sniperrifle_reload_ammo && self.clip_load <= 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_loaded = autocvar_g_balance_sniperrifle_reload_ammo;
+               self.clip_load = autocvar_g_balance_sniperrifle_reload_ammo;
        }
        return TRUE;
 };