]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Proper names
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 21 Jan 2011 00:16:12 +0000 (02:16 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 21 Jan 2011 00:16:12 +0000 (02:16 +0200)
qcsrc/server/cl_impulse.qc
qcsrc/server/cl_weapons.qc
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 ff3903cbad4f9d8e29f5c1c5e55d39c32b2b75a2..29c316e83d0bca6669968fd492e477d4d85dafd2 100644 (file)
@@ -98,7 +98,7 @@ void ImpulseCommands (void)
                                        W_PreviousWeapon (1);
                                        break;
                                case 20:
-                                       W_Reload ();
+                                       W_WepReload ();
                                        break;
                        }
                }
index 864dd77fce788cc1696e7bbdee82ac3309748a89..b2cb1af02a2159bc027fd9372f58c7959fce5cc1 100644 (file)
@@ -1,4 +1,4 @@
-void W_Reload()
+void W_WepReload()
 {
     self.wish_reload = 1;
 }
@@ -15,7 +15,7 @@ void W_SwitchWeapon(float imp)
        }
        else
        {
-               W_Reload();
+               W_WepReload();
        }
 };
 
index 6576ab2a0703c33591ac1ffe13006e1c96c41b0d..2391f8af09374662a5248877ff414737c799e8a3 100644 (file)
@@ -1618,7 +1618,7 @@ void W_SetupProjectileVelocity(entity missile, float pSpeed, float spread)
 
 float ammo_amount;
 
-float W_SniperRifle_CheckMaxBullets(float checkammo)
+float W_CheckMaxBullets(float checkammo)
 {
        float maxbulls;
        maxbulls = autocvar_g_balance_sniperrifle_magazinecapacity;
@@ -1627,37 +1627,37 @@ float W_SniperRifle_CheckMaxBullets(float checkammo)
        if(checkammo)
                if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
                        maxbulls = min(maxbulls, floor(ammo_amount / min(autocvar_g_balance_sniperrifle_primary_ammo, autocvar_g_balance_sniperrifle_secondary_ammo)));
-       if(self.sniperrifle_bulletcounter > maxbulls || !autocvar_g_balance_sniperrifle_magazinecapacity)
-               self.sniperrifle_bulletcounter = maxbulls;
-       return (self.sniperrifle_bulletcounter == maxbulls);
+       if(self.ammo_counter > maxbulls || !autocvar_g_balance_sniperrifle_magazinecapacity)
+               self.ammo_counter = maxbulls;
+       return (self.ammo_counter == maxbulls);
 }
 
-void W_SniperRifle_ReloadedAndReady()
+void W_ReloadedAndReady()
 {
        float t;
-       self.sniperrifle_bulletcounter = autocvar_g_balance_sniperrifle_magazinecapacity;
-       W_SniperRifle_CheckMaxBullets(TRUE);
+       self.ammo_counter = autocvar_g_balance_sniperrifle_magazinecapacity;
+       W_CheckMaxBullets(TRUE);
        t = ATTACK_FINISHED(self) - autocvar_g_balance_sniperrifle_reloadtime - 1;
        ATTACK_FINISHED(self) = t;
        w_ready();
 }
 
-float W_SniperRifle_Reload(float ammo_value)
+float W_Reload(float ammo_value)
 {
        float t;
 
-       W_SniperRifle_CheckMaxBullets(TRUE);
+       W_CheckMaxBullets(TRUE);
 
        ammo_amount = ammo_value; // save ammo to a global float
        if(ammo_amount < min(autocvar_g_balance_sniperrifle_primary_ammo, autocvar_g_balance_sniperrifle_secondary_ammo)) // when we get here, bulletcounter must be 0 or -1
        {
                print("cannot reload... not enough bullets\n");
-               self.sniperrifle_bulletcounter = -1; // reload later
+               self.ammo_counter = -1; // reload later
                W_SwitchToOtherWeapon(self);
                return 0;
        }
        
-       if (self.sniperrifle_bulletcounter >= autocvar_g_balance_sniperrifle_magazinecapacity)
+       if (self.ammo_counter >= autocvar_g_balance_sniperrifle_magazinecapacity)
                return 0;
 
        if (self.weaponentity)
@@ -1674,9 +1674,9 @@ float W_SniperRifle_Reload(float ammo_value)
        t = max(time, ATTACK_FINISHED(self)) + autocvar_g_balance_sniperrifle_reloadtime + 1;
        ATTACK_FINISHED(self) = t;
 
-       weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_sniperrifle_reloadtime, W_SniperRifle_ReloadedAndReady);
+       weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_sniperrifle_reloadtime, W_ReloadedAndReady);
 
-       self.sniperrifle_bulletcounter = -1;
+       self.ammo_counter = -1;
 
        return 1;
 }
index 970c86af429ecf3c4ef267ca4ef62b145e1afcad..e835738a099c73a318e206a97c6181eb449889c5 100644 (file)
@@ -612,7 +612,7 @@ float client_cefc_accumulator;
 float client_cefc_accumulatortime;
 #endif
 
-.float sniperrifle_bulletcounter;
+.float ammo_counter;
 .float wish_reload;
 
 #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_CORPSE; (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE
index 67fb91fc2b91c45a64c57bcbb999c66bfea8c370..a859d321186a894b46d6c5b669fd69ad863e438a 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_BULLETS_LOADED, AS_INT, sniperrifle_bulletcounter);
+       addstat(STAT_BULLETS_LOADED, AS_INT, ammo_counter);
        addstat(STAT_LAST_PICKUP, AS_FLOAT, last_pickup);
 
        addstat(STAT_NEX_CHARGE, AS_FLOAT, nex_charge);
index e5519551e050f6c535757dd5203a828e10177b43..267c75ffb60ea3f3ce7551aa8ed257f9936c9964 100644 (file)
@@ -6,7 +6,7 @@ REGISTER_WEAPON(SHOTGUN, w_shotgun, IT_SHELLS, 2, WEP_FLAG_NORMAL | WEP_TYPE_HIT
 void W_Shotgun_DoReload()
 {
        w_ready();
-       if(W_SniperRifle_Reload(self.ammo_shells))
+       if(W_Reload(self.ammo_shells))
                return;
 }
 
@@ -22,9 +22,9 @@ void W_Shotgun_Attack (void)
        float   bulletconstant;
        local entity flash;
 
-       if(self.sniperrifle_bulletcounter <= 0)
+       if(self.ammo_counter <= 0)
                W_Shotgun_DoReload();
-       if(self.sniperrifle_bulletcounter < 0)
+       if(self.ammo_counter < 0)
                return; // reloading, so we are done
 
        ammoamount = autocvar_g_balance_shotgun_primary_ammo;
@@ -57,7 +57,7 @@ void W_Shotgun_Attack (void)
        flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
        W_AttachToShotorg(flash, '5 0 0');
 
-       self.sniperrifle_bulletcounter = self.sniperrifle_bulletcounter - 1;
+       self.ammo_counter = self.ammo_counter - 1;
 }
 
 void shotgun_meleethink (void)
@@ -123,7 +123,7 @@ float w_shotgun(float req)
                        self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE);
        else if (req == WR_THINK)
        {
-               if(self.sniperrifle_bulletcounter < 0) // forced reload (e.g. because interrupted)
+               if(self.ammo_counter < 0) // forced reload (e.g. because interrupted)
             self.wish_reload = 1;
                else
                {
@@ -153,7 +153,7 @@ float w_shotgun(float req)
                 if(self.weaponentity.state == WS_READY)
                 {
                     self.wish_reload = 0;
-                    W_SniperRifle_Reload(self.ammo_shells);
+                    W_Reload(self.ammo_shells);
                 }
             }
         }
index 94f61e968a6de1dbcf00b5d3b0522ec2ef0b9f64..d2e5f775b6556c7a1f0e631e82dbb4ba78213583 100644 (file)
@@ -11,7 +11,7 @@ REGISTER_WEAPON(SNIPERRIFLE, w_sniperrifle, IT_NAILS, 7, WEP_FLAG_NORMAL | WEP_T
 void W_SniperRifle_DoReload()
 {
        w_ready();
-       if(W_SniperRifle_Reload(self.ammo_nails))
+       if(W_Reload(self.ammo_nails))
                return;
 }
 
@@ -42,7 +42,7 @@ void W_SniperRifle_FireBullet(float pSpread, float pDamage, float pHeadshotAdded
        if (autocvar_g_casings >= 2)
                SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
        
-       self.sniperrifle_bulletcounter = self.sniperrifle_bulletcounter - 1;
+       self.ammo_counter = self.ammo_counter - 1;
 }
 
 void W_SniperRifle_Attack()
@@ -73,9 +73,9 @@ void spawnfunc_weapon_campingrifle (void)
 void W_SniperRifle_BulletHail_Continue()
 {
        float r, sw, af;
-       if(self.sniperrifle_bulletcounter <= 0)
+       if(self.ammo_counter <= 0)
                W_SniperRifle_DoReload();
-       if(self.sniperrifle_bulletcounter < 0)
+       if(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);
@@ -147,7 +147,7 @@ float w_sniperrifle(float req)
        }
        else if (req == WR_THINK)
        {
-               if(self.sniperrifle_bulletcounter < 0) // forced reload (e.g. because interrupted)
+               if(self.ammo_counter < 0) // forced reload (e.g. because interrupted)
                {
             self.wish_reload = 1;
                }
@@ -188,7 +188,7 @@ float w_sniperrifle(float req)
                 if(self.weaponentity.state == WS_READY)
                 {
                     self.wish_reload = 0;
-                    W_SniperRifle_Reload(self.ammo_nails);
+                    W_Reload(self.ammo_nails);
                 }
             }
         }
@@ -206,10 +206,10 @@ float w_sniperrifle(float req)
        {
                weapon_setup(WEP_SNIPERRIFLE);
 
-               full = W_SniperRifle_CheckMaxBullets(TRUE);
+               full = W_CheckMaxBullets(TRUE);
                if(autocvar_g_balance_sniperrifle_auto_reload_on_switch)
                        if(!full)
-                               self.sniperrifle_bulletcounter = -1;
+                               self.ammo_counter = -1;
        }
        else if (req == WR_CHECKAMMO1)
                return self.ammo_nails >= autocvar_g_balance_sniperrifle_primary_ammo;
@@ -222,8 +222,8 @@ float w_sniperrifle(float req)
        else if (req == WR_RESETPLAYER)
        {
                self.sniperrifle_accumulator = time - autocvar_g_balance_sniperrifle_bursttime;
-               self.sniperrifle_bulletcounter = autocvar_g_balance_sniperrifle_magazinecapacity;
-               W_SniperRifle_CheckMaxBullets(FALSE);
+               self.ammo_counter = autocvar_g_balance_sniperrifle_magazinecapacity;
+               W_CheckMaxBullets(FALSE);
        }
        return TRUE;
 };