]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Proper naming for "ammo_field"
authorSamual Lenks <samual@xonotic.org>
Tue, 31 Dec 2013 16:34:21 +0000 (11:34 -0500)
committerSamual Lenks <samual@xonotic.org>
Tue, 31 Dec 2013 16:34:21 +0000 (11:34 -0500)
15 files changed:
qcsrc/client/hud.qc
qcsrc/common/weapons/w_blaster.qc
qcsrc/common/weapons/w_fireball.qc
qcsrc/common/weapons/w_porto.qc
qcsrc/common/weapons/w_shotgun.qc
qcsrc/common/weapons/w_tuba.qc
qcsrc/common/weapons/w_vaporizer.qc
qcsrc/common/weapons/weapons.qc
qcsrc/common/weapons/weapons.qh
qcsrc/server/mutators/mutator_nix.qc
qcsrc/server/t_items.qc
qcsrc/server/t_items.qh
qcsrc/server/weapons/spawning.qc
qcsrc/server/weapons/throwing.qc
qcsrc/server/weapons/weaponsystem.qc

index 9b778b9897564b0a15e686438ff679493895ef46..9c26e61a8ec006be07b2e1b8e890120b2d75cf5f 100644 (file)
@@ -784,7 +784,7 @@ void HUD_Weapons(void)
                        }
 
                        // draw ammo status bar
-                       if(autocvar_hud_panel_weapons_ammo && self.current_ammo != ammo_none)
+                       if(autocvar_hud_panel_weapons_ammo && self.ammo_field != ammo_none)
                        {
                                a = 0;
                                ammo_type = GetAmmoTypeForWep(self.weapon);
index 7566d10ec96f361684b120a78b4db9826ff1e33c..3d0fced425840d747bdf3be5db5644da3084f188 100644 (file)
@@ -228,7 +228,7 @@ float W_Blaster(float request)
                
                case WR_SETUP:
                {
-                       self.current_ammo = ammo_none;
+                       self.ammo_field = ammo_none;
                        return TRUE;
                }
                
index ad2e426257628b8b0327275dcdc2066d90d8250f..07b137159bc31d0a46eb318768d01307116fa4bf 100644 (file)
@@ -406,7 +406,7 @@ float W_Fireball(float req)
                }
                case WR_SETUP:
                {
-                       self.current_ammo = ammo_none;
+                       self.ammo_field = ammo_none;
                        return TRUE;
                }
                case WR_CHECKAMMO1:
index e0bf83ba456c032d45d86a7c3bb535fa56b4682d..c5b5585d802c397d8c2174926fd4f0f303464017 100644 (file)
@@ -379,7 +379,7 @@ float W_Porto(float req)
                }
                case WR_SETUP:
                {
-                       self.current_ammo = ammo_none;
+                       self.ammo_field = ammo_none;
                        return TRUE;
                }
                case WR_RESETPLAYER:
index bb20240af973d2689074433785887e2a8a178e3b..4a678607d2f63c9a3d14495980ecdb0fde669c63 100644 (file)
@@ -249,7 +249,7 @@ float W_Shotgun(float req)
                }
                case WR_SETUP:
                {
-                       self.current_ammo = ammo_none;
+                       self.ammo_field = ammo_none;
                        return TRUE;
                }
                case WR_CHECKAMMO1:
index 7db2bd4e9d697c00770fd22a1b84ca008a405225..8adbcd024658631fb8d58d5169c736f9ff29b826 100644 (file)
@@ -419,7 +419,7 @@ float W_Tuba(float req)
                }
                case WR_SETUP:
                {
-                       self.current_ammo = ammo_none;
+                       self.ammo_field = ammo_none;
                        self.tuba_instrument = 0;
                        return TRUE;
                }
index 63c9bb5cfcfcb9577aaa8b596cd07a91541c87c3..2af1be72a091e7c912290bd0a65c2435308c7db8 100644 (file)
@@ -196,7 +196,7 @@ float W_Vaporizer(float req)
                }
                case WR_SETUP:
                {
-                       self.current_ammo = AMMO_VAL(WEP_VAPORIZER);
+                       self.ammo_field = AMMO_VAL(WEP_VAPORIZER);
                        self.vaporizer_lasthit = 0;
                        return TRUE;
                }
index 121df37b2129cce7f680ce5bdcdb90206d7461cf..7d33f1e82ed29786990d9080c47bb6daa3e14ab5 100644 (file)
@@ -92,7 +92,7 @@ void register_weapon(float id, WepSet bit, float(float) func, .float ammotype, f
        e.model2 = strzone(strcat("wpn-", ftos(id)));
        e.impulse = i;
        e.bot_pickupbasevalue = pickupbasevalue;
-       e.current_ammo = ammotype;
+       e.ammo_field = ammotype;
 
        #ifndef MENUQC
        func(WR_INIT);
@@ -118,7 +118,7 @@ void register_weapons_done()
        dummy_weapon_info.model2 = "";
        dummy_weapon_info.impulse = -1;
        dummy_weapon_info.bot_pickupbasevalue = 0;
-       dummy_weapon_info.current_ammo = ammo_none;
+       dummy_weapon_info.ammo_field = ammo_none;
 
        float i;
        weaponorder_byid = "";
index 732c5136340399aab417cbb598911074ff7629de..a506f4149a9fd6eef05e965c401ec183970564a7 100644 (file)
@@ -137,11 +137,11 @@ string W_Name(float weaponid);
 .float impulse; // weapon impulse
 .float bot_pickupbasevalue; // bot weapon priority
 .string model2; // wpn- sprite name
-..float current_ammo; // main ammo field
+..float ammo_field; // main ammo field
 
 // other useful macros
 #define WEP_ACTION(wpn,wrequest) (get_weaponinfo(wpn)).weapon_func(wrequest)
-#define AMMO_VAL(wpn) ((get_weaponinfo(wpn)).current_ammo)
+#define AMMO_VAL(wpn) ((get_weaponinfo(wpn)).ammo_field)
 
 // =====================
 //  Weapon Registration
index 29153f1a1698d0a3b01c96e7544f07a1286b14b5..4603a1cca785d0a33a860276cbc362cdfcca26de 100644 (file)
@@ -68,7 +68,7 @@ void NIX_GiveCurrentWeapon()
                
                if(self.items & IT_UNLIMITED_WEAPON_AMMO)
                {
-                       switch(e.current_ammo)
+                       switch(e.ammo_field)
                        {
                                case ammo_shells:  self.ammo_shells  = autocvar_g_pickup_shells_max;  break;
                                case ammo_nails:   self.ammo_nails   = autocvar_g_pickup_nails_max;   break;
@@ -79,7 +79,7 @@ void NIX_GiveCurrentWeapon()
                }
                else
                {
-                       switch(e.current_ammo)
+                       switch(e.ammo_field)
                        {
                                case ammo_shells:  self.ammo_shells  = autocvar_g_balance_nix_ammo_shells;  break;
                                case ammo_nails:   self.ammo_nails   = autocvar_g_balance_nix_ammo_nails;   break;
@@ -121,7 +121,7 @@ void NIX_GiveCurrentWeapon()
 
        if(!(self.items & IT_UNLIMITED_WEAPON_AMMO) && time > self.nix_nextincr)
        {
-               switch(e.current_ammo)
+               switch(e.ammo_field)
                {
                        case ammo_shells:  self.ammo_shells  += autocvar_g_balance_nix_ammoincr_shells;  break;
                        case ammo_nails:   self.ammo_nails   += autocvar_g_balance_nix_ammoincr_nails;   break;
index c51ea58d96afa65d36e868551124e1e8d9699129..62dd374db9cb9c39780b057b41152a5fa728fa22 100644 (file)
@@ -505,25 +505,25 @@ void Item_ScheduleInitialRespawn(entity e)
        Item_ScheduleRespawnIn(e, game_starttime - time + ITEM_RESPAWNTIME_INITIAL(e));
 }
 
-float Item_GiveAmmoTo(entity item, entity player, .float ammofield, float ammomax, float mode)
+float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax, float mode)
 {
-       if (!item.ammofield)
+       if (!item.ammotype)
                return FALSE;
 
        if (item.spawnshieldtime)
        {
-               if ((player.ammofield < ammomax) || item.pickup_anyway)
+               if ((player.ammotype < ammomax) || item.pickup_anyway)
                {
-                       player.ammofield = bound(player.ammofield, ammomax, player.ammofield + item.ammofield);
+                       player.ammotype = bound(player.ammotype, ammomax, player.ammotype + item.ammotype);
                        goto YEAH;
                }
        }
        else if(g_weapon_stay == 2)
        {
-               float mi = min(item.ammofield, ammomax);
-               if (player.ammofield < mi)
+               float mi = min(item.ammotype, ammomax);
+               if (player.ammotype < mi)
                {
-                       player.ammofield = mi;
+                       player.ammotype = mi;
                        goto YEAH;
                }
        }
index 2480e5f5559323d5c59ed93b34f0bfb211cce114..a30af11d2abbbe2db85270008b525be50f89b496 100644 (file)
@@ -67,7 +67,7 @@ float ITEM_MODE_NONE = 0;
 float ITEM_MODE_HEALTH = 1;
 float ITEM_MODE_ARMOR = 2;
 float ITEM_MODE_FUEL = 3;
-float Item_GiveAmmoTo(entity item, entity player, .float ammofield, float ammomax, float mode);
+float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax, float mode);
 
 float Item_GiveTo(entity item, entity player);
 
index 94d6d2135a9ee70cc3781e4da6fb10d78b8784fb..409dbfe07e09345d362075c4fe5036af0face583 100644 (file)
@@ -131,9 +131,9 @@ void weapon_defaultspawnfunc(float wpn)
                        self.superweapons_finished = autocvar_g_balance_superweapons_time;
 
        // if we don't already have ammo, give us some ammo
-       if(!self.(e.current_ammo))
+       if(!self.(e.ammo_field))
        {
-               switch(e.current_ammo)
+               switch(e.ammo_field)
                {
                        case ammo_shells:  self.ammo_shells  = cvar("g_pickup_shells_weapon");  break;
                        case ammo_nails:   self.ammo_nails   = cvar("g_pickup_nails_weapon");   break;
@@ -150,9 +150,9 @@ void weapon_defaultspawnfunc(float wpn)
                {
                        if(e.items & j)
                        {
-                               ammofield = Item_CounterField(j);
-                               if(!self.ammofield)
-                                       self.ammofield = cvar(strcat("g_pickup_", Item_CounterFieldName(j), "_weapon"));
+                               ammotype = Item_CounterField(j);
+                               if(!self.ammotype)
+                                       self.ammotype = cvar(strcat("g_pickup_", Item_CounterFieldName(j), "_weapon"));
                        }
                }
        }
index 7ac461969c102574bc076a4ea98242665a6964a7..bf71da4c48a688b449418a5acc41044b6742a3d5 100644 (file)
@@ -22,7 +22,7 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
        entity oldself, wep;
        float thisammo, i;
        string s;
-       var .float ammofield = (get_weaponinfo(wpn)).current_ammo;
+       var .float ammotype = (get_weaponinfo(wpn)).ammo_field;
 
        wep = spawn();
 
@@ -74,7 +74,7 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
        wep.pickup_anyway = TRUE; // these are ALWAYS pickable
        
        //wa = W_AmmoItemCode(wpn);
-       if(ammofield == ammo_none)
+       if(ammotype == ammo_none)
        {
                return "";
        }
@@ -87,26 +87,26 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
                        // if our weapon is loaded, give its load back to the player
                        if(self.(weapon_load[self.weapon]) > 0)
                        {
-                               own.ammofield += self.(weapon_load[self.weapon]);
+                               own.ammotype += self.(weapon_load[self.weapon]);
                                self.(weapon_load[self.weapon]) = -1; // schedule the weapon for reloading
                        }
 
-                       wep.ammofield = 0;
+                       wep.ammotype = 0;
                }
                else if(doreduce)
                {
                        // if our weapon is loaded, give its load back to the player
                        if(self.(weapon_load[self.weapon]) > 0)
                        {
-                               own.ammofield += self.(weapon_load[self.weapon]);
+                               own.ammotype += self.(weapon_load[self.weapon]);
                                self.(weapon_load[self.weapon]) = -1; // schedule the weapon for reloading
                        }
 
-                       thisammo = min(own.ammofield, wep.ammofield);
-                       wep.ammofield = thisammo;
-                       own.ammofield -= thisammo;
+                       thisammo = min(own.ammotype, wep.ammotype);
+                       wep.ammotype = thisammo;
+                       own.ammotype -= thisammo;
 
-                       switch(ammofield)
+                       switch(ammotype)
                        {
                                case ammo_shells:  s = sprintf("%s and %d shells", s, thisammo);  break;
                                case ammo_nails:   s = sprintf("%s and %d nails", s, thisammo);   break;
@@ -139,7 +139,7 @@ float W_IsWeaponThrowable(float w)
                // start weapons that take no ammo can't be dropped (this prevents dropping the laser, as long as it continues to use no ammo)
                if(start_items & IT_UNLIMITED_WEAPON_AMMO)
                        return 0;
-               if((get_weaponinfo(w)).current_ammo == ammo_none)
+               if((get_weaponinfo(w)).ammo_field == ammo_none)
                        return 0;
        }
 
index e5145927d50ee1958f77bf368c1084a818026158..da98d7f1cad869718334d004e52299ba4780d5dd 100644 (file)
@@ -686,7 +686,7 @@ void W_WeaponFrame()
                        self.weapon = self.switchweapon;
                        self.weaponname = newwep.mdl;
                        self.bulletcounter = 0; // WEAPONTODO
-                       //self.current_ammo = newwep.current_ammo;
+                       //self.ammo_field = newwep.ammo_field;
                        WEP_ACTION(self.switchweapon, WR_SETUP);
                        self.weaponentity.state = WS_RAISE;
 
@@ -823,7 +823,7 @@ void W_DecreaseAmmo(float ammo_use)
                self.(weapon_load[self.weapon]) = self.clip_load;
        }
        else
-               self.(wep.current_ammo) -= ammo_use;
+               self.(wep.ammo_field) -= ammo_use;
 }
 
 // weapon reloading code
@@ -839,14 +839,14 @@ void W_ReloadedAndReady()
        self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading
 
        // if the gun uses no ammo, max out weapon load, else decrease ammo as we increase weapon load
-       if(!self.reload_ammo_min || self.items & IT_UNLIMITED_WEAPON_AMMO || self.current_ammo == ammo_none)
+       if(!self.reload_ammo_min || self.items & IT_UNLIMITED_WEAPON_AMMO || self.ammo_field == ammo_none)
                self.clip_load = self.reload_ammo_amount;
        else
        {
-               while(self.clip_load < self.reload_ammo_amount && self.(self.current_ammo)) // make sure we don't add more ammo than we have
+               while(self.clip_load < self.reload_ammo_amount && self.(self.ammo_field)) // make sure we don't add more ammo than we have
                {
                        self.clip_load += 1;
-                       self.(self.current_ammo) -= 1;
+                       self.(self.ammo_field) -= 1;
                }
        }
        self.(weapon_load[self.weapon]) = self.clip_load;
@@ -887,8 +887,8 @@ void W_Reload(float sent_ammo_min, string sent_sound)
                return;
 
        // no ammo, so nothing to load
-       if(self.current_ammo != ammo_none)
-       if(!self.(self.current_ammo) && self.reload_ammo_min)
+       if(self.ammo_field != ammo_none)
+       if(!self.(self.ammo_field) && self.reload_ammo_min)
        if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
        {
                if(IS_REAL_CLIENT(self) && self.reload_complain < time)