]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use .current_ammo instead of specific ammo fields
authorSamual Lenks <samual@xonotic.org>
Wed, 11 Dec 2013 01:31:33 +0000 (20:31 -0500)
committerSamual Lenks <samual@xonotic.org>
Wed, 11 Dec 2013 01:31:33 +0000 (20:31 -0500)
14 files changed:
qcsrc/common/weapons/w_arc.qc
qcsrc/common/weapons/w_crylink.qc
qcsrc/common/weapons/w_devastator.qc
qcsrc/common/weapons/w_electro.qc
qcsrc/common/weapons/w_hagar.qc
qcsrc/common/weapons/w_hlac.qc
qcsrc/common/weapons/w_hook.qc
qcsrc/common/weapons/w_machinegun.qc
qcsrc/common/weapons/w_minelayer.qc
qcsrc/common/weapons/w_minstanex.qc
qcsrc/common/weapons/w_mortar.qc
qcsrc/common/weapons/w_nex.qc
qcsrc/common/weapons/w_rifle.qc
qcsrc/common/weapons/w_seeker.qc

index 2f2d2ea9d03ae58230ec14904f155e1b95d44f76..aad7bd72b873551df2e548e4a0a6dbf1b5932b58 100644 (file)
@@ -78,7 +78,7 @@ void W_Arc_Beam_Think()
                remove(self);
                return;
        }
-       if (self.owner.weaponentity.state != WS_INUSE || (self.owner.ammo_cells <= 0 && !(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)) || self.owner.deadflag != DEAD_NO || !self.owner.BUTTON_ATCK || self.owner.freezetag_frozen)
+       if (self.owner.weaponentity.state != WS_INUSE || (self.owner.(self.current_ammo) <= 0 && !(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)) || self.owner.deadflag != DEAD_NO || !self.owner.BUTTON_ATCK || self.owner.freezetag_frozen)
        {
                if(self == self.owner.arc_beam)
                        self.owner.arc_beam = world;
@@ -96,8 +96,8 @@ void W_Arc_Beam_Think()
        {
                if(WEP_CVAR_PRI(arc, ammo))
                {
-                       dt = min(dt, self.owner.ammo_cells / WEP_CVAR_PRI(arc, ammo));
-                       self.owner.ammo_cells = max(0, self.owner.ammo_cells - WEP_CVAR_PRI(arc, ammo) * frametime);
+                       dt = min(dt, self.owner.(self.current_ammo) / WEP_CVAR_PRI(arc, ammo));
+                       self.owner.(self.current_ammo) = max(0, self.owner.(self.current_ammo) - WEP_CVAR_PRI(arc, ammo) * frametime);
                }
        }
 
@@ -253,11 +253,11 @@ float w_arc(float req)
                }
                case WR_CHECKAMMO1:
                {
-                       return !WEP_CVAR_PRI(arc, ammo) || (self.ammo_cells > 0);
+                       return !WEP_CVAR_PRI(arc, ammo) || (self.(self.current_ammo) > 0);
                }
                case WR_CHECKAMMO2:
                {
-                       return self.ammo_cells >= WEP_CVAR_SEC(arc, ammo);
+                       return self.(self.current_ammo) >= WEP_CVAR_SEC(arc, ammo);
                }
                case WR_CONFIG:
                {
index 63ca43a00e1cdce69d483eae7b78bdbfe48c4fb6..704b8e5b923946415a4b35aea02431db9f0268c5 100644 (file)
@@ -641,18 +641,13 @@ float w_crylink(float req)
                        CRYLINK_SETTINGS(WEP_SKIPCVAR, WEP_SET_PROP)
                        return TRUE;
                }
-               case WR_SETUP:
-               {
-                       self.current_ammo = ammo_cells;
-                       return TRUE;
-               }
                case WR_CHECKAMMO1:
                {
                        // don't "run out of ammo" and switch weapons while waiting for release
                        if(self.crylink_lastgroup && self.crylink_waitrelease)
                                return TRUE;
 
-                       ammo_amount = self.ammo_cells >= WEP_CVAR_PRI(crylink, ammo);
+                       ammo_amount = self.(self.current_ammo) >= WEP_CVAR_PRI(crylink, ammo);
                        ammo_amount += self.(weapon_load[WEP_CRYLINK]) >= WEP_CVAR_PRI(crylink, ammo);
                        return ammo_amount;
                }
@@ -662,7 +657,7 @@ float w_crylink(float req)
                        if(self.crylink_lastgroup && self.crylink_waitrelease)
                                return TRUE;
 
-                       ammo_amount = self.ammo_cells >= WEP_CVAR_SEC(crylink, ammo);
+                       ammo_amount = self.(self.current_ammo) >= WEP_CVAR_SEC(crylink, ammo);
                        ammo_amount += self.(weapon_load[WEP_CRYLINK]) >= WEP_CVAR_SEC(crylink, ammo);
                        return ammo_amount;
                }
index d10ee43a1c0ce3991459938d4b269dd034d2c501..66bd112a87421d3b4f08d48aff3e64fd5edf9d1b 100644 (file)
@@ -81,7 +81,7 @@ void W_Devastator_Explode()
 
        if (self.realowner.weapon == WEP_DEVASTATOR)
        {
-               if(self.realowner.ammo_rockets < WEP_CVAR(devastator, ammo))
+               if(self.realowner.(self.current_ammo) < WEP_CVAR(devastator, ammo))
                {
                        self.realowner.cnt = WEP_DEVASTATOR;
                        ATTACK_FINISHED(self.realowner) = time;
@@ -102,7 +102,7 @@ void W_Devastator_DoRemoteExplode()
 
        if (self.realowner.weapon == WEP_DEVASTATOR)
        {
-               if(self.realowner.ammo_rockets < WEP_CVAR(devastator, ammo))
+               if(self.realowner.(self.current_ammo) < WEP_CVAR(devastator, ammo))
                {
                        self.realowner.cnt = WEP_DEVASTATOR;
                        ATTACK_FINISHED(self.realowner) = time;
@@ -403,7 +403,6 @@ float W_Devastator(float req)
                }
                case WR_SETUP:
                {
-                       self.current_ammo = ammo_rockets;
                        self.rl_release = 1;
                        return TRUE;
                }
@@ -415,10 +414,10 @@ float W_Devastator(float req)
                                ammo_amount = FALSE;
                                if(WEP_CVAR(devastator, reload_ammo))
                                {
-                                       if(self.ammo_rockets < WEP_CVAR(devastator, ammo) && self.(weapon_load[WEP_DEVASTATOR]) < WEP_CVAR(devastator, ammo))
+                                       if(self.(self.current_ammo) < WEP_CVAR(devastator, ammo) && self.(weapon_load[WEP_DEVASTATOR]) < WEP_CVAR(devastator, ammo))
                                                ammo_amount = TRUE;
                                }
-                               else if(self.ammo_rockets < WEP_CVAR(devastator, ammo))
+                               else if(self.(self.current_ammo) < WEP_CVAR(devastator, ammo))
                                        ammo_amount = TRUE;
                                return !ammo_amount;
                        }
index 05df53a0da86fa27b91e19b061a497f4fbe9197e..d5cba995d5d4525f8b4bef352e6c2f7015dfdace 100644 (file)
@@ -485,14 +485,9 @@ float W_Electro(float req)
                        ELECTRO_SETTINGS(WEP_SKIPCVAR, WEP_SET_PROP)
                        return TRUE;
                }
-               case WR_SETUP:
-               {
-                       self.current_ammo = ammo_cells;
-                       return TRUE;
-               }
                case WR_CHECKAMMO1:
                {
-                       ammo_amount = self.ammo_cells >= WEP_CVAR_PRI(electro, ammo);
+                       ammo_amount = self.(self.current_ammo) >= WEP_CVAR_PRI(electro, ammo);
                        ammo_amount += self.(weapon_load[WEP_ELECTRO]) >= WEP_CVAR_PRI(electro, ammo);
                        return ammo_amount;
                }
@@ -500,12 +495,12 @@ float W_Electro(float req)
                {
                        if(WEP_CVAR(electro, combo_safeammocheck)) // true if you can fire at least one secondary blob AND one primary shot after it, otherwise false.
                        {
-                               ammo_amount = self.ammo_cells >= WEP_CVAR_SEC(electro, ammo) + WEP_CVAR_PRI(electro, ammo);
+                               ammo_amount = self.(self.current_ammo) >= WEP_CVAR_SEC(electro, ammo) + WEP_CVAR_PRI(electro, ammo);
                                ammo_amount += self.(weapon_load[WEP_ELECTRO]) >= WEP_CVAR_SEC(electro, ammo) + WEP_CVAR_PRI(electro, ammo);
                        }
                        else
                        {
-                               ammo_amount = self.ammo_cells >= WEP_CVAR_SEC(electro, ammo);
+                               ammo_amount = self.(self.current_ammo) >= WEP_CVAR_SEC(electro, ammo);
                                ammo_amount += self.(weapon_load[WEP_ELECTRO]) >= WEP_CVAR_SEC(electro, ammo);
                        }
                        return ammo_amount;
index 8f1b4204a9b83a317111119776c3dde1a9006ed5..87863a1946c555b957afbda219b3b7121104edd6 100644 (file)
@@ -297,7 +297,7 @@ void W_Hagar_Attack2_Load (void)
        if(autocvar_g_balance_hagar_reload_ammo)
                enough_ammo = self.(weapon_load[WEP_HAGAR]) >= WEP_CVAR_SEC(hagar, ammo);
        else
-               enough_ammo = self.ammo_rockets >= WEP_CVAR_SEC(hagar, ammo);
+               enough_ammo = self.(self.current_ammo) >= WEP_CVAR_SEC(hagar, ammo);
 
        if(self.BUTTON_ATCK2)
        {
@@ -451,7 +451,6 @@ float w_hagar(float req)
                }
                case WR_SETUP:
                {
-                       self.current_ammo = ammo_rockets;
                        self.hagar_loadblock = FALSE;
 
                        if(self.hagar_load)
@@ -464,13 +463,13 @@ float w_hagar(float req)
                }
                case WR_CHECKAMMO1:
                {
-                       ammo_amount = self.ammo_rockets >= WEP_CVAR_PRI(hagar, ammo);
+                       ammo_amount = self.(self.current_ammo) >= WEP_CVAR_PRI(hagar, ammo);
                        ammo_amount += self.(weapon_load[WEP_HAGAR]) >= WEP_CVAR_PRI(hagar, ammo);
                        return ammo_amount;
                }
                case WR_CHECKAMMO2:
                {
-                       ammo_amount = self.ammo_rockets >= WEP_CVAR_SEC(hagar, ammo);
+                       ammo_amount = self.(self.current_ammo) >= WEP_CVAR_SEC(hagar, ammo);
                        ammo_amount += self.(weapon_load[WEP_HAGAR]) >= WEP_CVAR_SEC(hagar, ammo);
                        return ammo_amount;
                }
index ae21c4c338f98bae6b055731e8a8c138139c2747..a01b8681230d60aaaab3811dcc46d1f3e4db2776 100644 (file)
@@ -242,20 +242,15 @@ float w_hlac(float req)
                        HLAC_SETTINGS(WEP_SKIPCVAR, WEP_SET_PROP)
                        return TRUE;
                }
-               case WR_SETUP:
-               {
-                       self.current_ammo = ammo_cells;
-                       return TRUE;
-               }
                case WR_CHECKAMMO1:
                {
-                       ammo_amount = self.ammo_cells >= WEP_CVAR_PRI(hlac, ammo);
+                       ammo_amount = self.(self.current_ammo) >= WEP_CVAR_PRI(hlac, ammo);
                        ammo_amount += self.(weapon_load[WEP_HLAC]) >= WEP_CVAR_PRI(hlac, ammo);
                        return ammo_amount;
                }
                case WR_CHECKAMMO2:
                {
-                       ammo_amount = self.ammo_cells >= WEP_CVAR_SEC(hlac, ammo);
+                       ammo_amount = self.(self.current_ammo) >= WEP_CVAR_SEC(hlac, ammo);
                        ammo_amount += self.(weapon_load[WEP_HLAC]) >= WEP_CVAR_SEC(hlac, ammo);
                        return ammo_amount;
                }
index bf9fc160e26f1ab2d6bff10121548e10afc6edf7..34496f65c42814e46f07d44656071eb096284fd6 100644 (file)
@@ -14,8 +14,8 @@ REGISTER_WEAPON(
 #define HOOK_SETTINGS(w_cvar,w_prop) HOOK_SETTINGS_LIST(w_cvar, w_prop, HOOK, hook)
 #define HOOK_SETTINGS_LIST(w_cvar,w_prop,id,sn) \
        w_cvar(id, sn, BOTH, animtime) \
-       w_cvar(id, sn, BOTH, ammo) \
        w_cvar(id, sn, BOTH, refire) \
+       w_cvar(id, sn, PRI, ammo) \
        w_cvar(id, sn, PRI,  hooked_ammo) \
        w_cvar(id, sn, PRI,  hooked_time_free) \
        w_cvar(id, sn, PRI,  hooked_time_max) \
@@ -127,7 +127,7 @@ void W_Hook_Attack2()
 {
        entity gren;
 
-       W_DecreaseAmmo(WEP_CVAR_SEC(hook, ammo));
+       //W_DecreaseAmmo(WEP_CVAR_SEC(hook, ammo)); // WEAPONTODO: Figure out how to handle ammo with hook secondary (gravitybomb)
        W_SetupShot (self, FALSE, 4, "weapons/hookbomb_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hook, damage));
 
        gren = spawn ();
@@ -293,7 +293,6 @@ float w_hook(float req)
                }
                case WR_SETUP:
                {
-                       self.current_ammo = ammo_fuel;
                        self.hook_state &= ~HOOK_WAITING_FOR_RELEASE;
                        return TRUE;
                }
@@ -306,7 +305,8 @@ float w_hook(float req)
                }
                case WR_CHECKAMMO2:
                {
-                       return self.ammo_cells >= WEP_CVAR_SEC(hook, ammo);
+                       // infinite ammo for now
+                       return TRUE; // self.ammo_cells >= WEP_CVAR_SEC(hook, ammo); // WEAPONTODO: see above
                }
                case WR_CONFIG:
                {
index db222260e805c6e66487e55ccb6a5622bee4051f..18dec54fdcbc27c74c0fa448d2b48af7961a0c83 100644 (file)
@@ -311,17 +311,12 @@ float w_uzi(float req)
                        UZI_SETTINGS(WEP_SKIPCVAR, WEP_SET_PROP)
                        return TRUE;
                }
-               case WR_SETUP:
-               {
-                       self.current_ammo = ammo_nails;
-                       return TRUE;
-               }
                case WR_CHECKAMMO1:
                {
                        if(WEP_CVAR(uzi, mode) == 1)
-                               ammo_amount = self.ammo_nails >= WEP_CVAR(uzi, sustained_ammo);
+                               ammo_amount = self.(self.current_ammo) >= WEP_CVAR(uzi, sustained_ammo);
                        else
-                               ammo_amount = self.ammo_nails >= WEP_CVAR(uzi, first_ammo);
+                               ammo_amount = self.(self.current_ammo) >= WEP_CVAR(uzi, first_ammo);
 
                        if(autocvar_g_balance_uzi_reload_ammo)
                        {
@@ -335,9 +330,9 @@ float w_uzi(float req)
                case WR_CHECKAMMO2:
                {
                        if(WEP_CVAR(uzi, mode) == 1)
-                               ammo_amount = self.ammo_nails >= WEP_CVAR(uzi, burst_ammo);
+                               ammo_amount = self.(self.current_ammo) >= WEP_CVAR(uzi, burst_ammo);
                        else
-                               ammo_amount = self.ammo_nails >= WEP_CVAR(uzi, first_ammo);
+                               ammo_amount = self.(self.current_ammo) >= WEP_CVAR(uzi, first_ammo);
 
                        if(autocvar_g_balance_uzi_reload_ammo)
                        {
index a3b0f0cc10a678bf2a899d044dfbfae82f621ab8..3210f4c8379a2ca36dd6f5a84795bfbc86a3129e 100644 (file)
@@ -504,7 +504,7 @@ float w_minelayer(float req)
                        if(autocvar_g_balance_minelayer_reload_ammo && self.clip_load < WEP_CVAR(minelayer, ammo)) // forced reload
                        {
                                // not if we're holding the minelayer without enough ammo, but can detonate existing mines
-                               if(!(W_PlacedMines(FALSE) && self.ammo_rockets < WEP_CVAR(minelayer, ammo)))
+                               if(!(W_PlacedMines(FALSE) && self.(self.current_ammo) < WEP_CVAR(minelayer, ammo)))
                                        WEP_ACTION(self.weapon, WR_RELOAD);
                        }
                        else if (self.BUTTON_ATCK)
@@ -538,17 +538,12 @@ float w_minelayer(float req)
                        MINELAYER_SETTINGS(WEP_SKIPCVAR, WEP_SET_PROP)
                        return TRUE;
                }
-               case WR_SETUP:
-               {
-                       self.current_ammo = ammo_rockets;
-                       return TRUE;
-               }
                case WR_CHECKAMMO1:
                {
                        // don't switch while placing a mine
                        if (ATTACK_FINISHED(self) <= time || self.weapon != WEP_MINE_LAYER)
                        {
-                               ammo_amount = self.ammo_rockets >= WEP_CVAR(minelayer, ammo);
+                               ammo_amount = self.(self.current_ammo) >= WEP_CVAR(minelayer, ammo);
                                ammo_amount += self.(weapon_load[WEP_MINE_LAYER]) >= WEP_CVAR(minelayer, ammo);
                                return ammo_amount;
                        }
index f42a581531a4d81c6ebac71b0112261d70c1c19f..007825c194cb971058f6c4a40fba8dc4a01e6bb4 100644 (file)
@@ -120,7 +120,7 @@ float w_minstanex(float req)
        {
                case WR_AIM:
                {
-                       if(self.ammo_cells > 0)
+                       if(self.(self.current_ammo) > 0)
                                self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
                        else
                                self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(minstanex, speed), 0, WEP_CVAR_SEC(minstanex, lifetime), FALSE); // WEAPONTODO: replace with proper minstanex cvars
@@ -194,13 +194,13 @@ float w_minstanex(float req)
                }
                case WR_SETUP:
                {
-                       self.current_ammo = ammo_cells;
+                       self.current_ammo = (self.current_ammo);
                        self.minstanex_lasthit = 0;
                        return TRUE;
                }
                case WR_CHECKAMMO1:
                {
-                       ammo_amount = self.ammo_cells >= minstanex_ammo;
+                       ammo_amount = self.(self.current_ammo) >= minstanex_ammo;
                        ammo_amount += self.(weapon_load[WEP_MINSTANEX]) >= minstanex_ammo;
                        return ammo_amount;
                }
@@ -208,7 +208,7 @@ float w_minstanex(float req)
                {
                        if(!WEP_CVAR_SEC(minstanex, ammo))
                                return TRUE;
-                       ammo_amount = self.ammo_cells >= WEP_CVAR_SEC(minstanex, ammo);
+                       ammo_amount = self.(self.current_ammo) >= WEP_CVAR_SEC(minstanex, ammo);
                        ammo_amount += self.(weapon_load[WEP_MINSTANEX]) >= WEP_CVAR_SEC(minstanex, ammo);
                        return ammo_amount;
                }
index c25b4e38919f437e053916fdabead2b058dd3abc..b5d7a93a37277149269281b0c292f055451fe0d6 100644 (file)
@@ -414,20 +414,15 @@ float w_glauncher(float req)
                        MORTAR_SETTINGS(WEP_SKIPCVAR, WEP_SET_PROP)
                        return TRUE;
                }
-               case WR_SETUP:
-               {
-                       self.current_ammo = ammo_rockets;
-                       return TRUE;
-               }
                case WR_CHECKAMMO1:
                {
-                       ammo_amount = self.ammo_rockets >= WEP_CVAR_PRI(mortar, ammo);
+                       ammo_amount = self.(self.current_ammo) >= WEP_CVAR_PRI(mortar, ammo);
                        ammo_amount += self.(weapon_load[WEP_MORTAR]) >= WEP_CVAR_PRI(mortar, ammo);
                        return ammo_amount;
                }
                case WR_CHECKAMMO2:
                {
-                       ammo_amount = self.ammo_rockets >= WEP_CVAR_SEC(mortar, ammo);
+                       ammo_amount = self.(self.current_ammo) >= WEP_CVAR_SEC(mortar, ammo);
                        ammo_amount += self.(weapon_load[WEP_MORTAR]) >= WEP_CVAR_SEC(mortar, ammo);
                        return ammo_amount;
                }
index 7710fcced4af3e863782fa25c39781bb34dac3fe..9a7a423bed450ee0ca364fbc0279f346875a3a1d 100644 (file)
@@ -202,11 +202,11 @@ float w_nex(float req)
                                                                                }
                                                                                else
                                                                                {
-                                                                                       dt = min(dt, (self.ammo_cells - WEP_CVAR_PRI(nex, ammo)) / WEP_CVAR_SEC(nex, ammo));
+                                                                                       dt = min(dt, (self.(self.current_ammo) - WEP_CVAR_PRI(nex, ammo)) / WEP_CVAR_SEC(nex, ammo));
                                                                                        dt = max(0, dt);
                                                                                        if(dt > 0)
                                                                                        {
-                                                                                               self.ammo_cells = max(WEP_CVAR_SEC(nex, ammo), self.ammo_cells - WEP_CVAR_SEC(nex, ammo) * dt);
+                                                                                               self.(self.current_ammo) = max(WEP_CVAR_SEC(nex, ammo), self.(self.current_ammo) - WEP_CVAR_SEC(nex, ammo) * dt);
                                                                                        }
                                                                                }
                                                                        }
@@ -248,14 +248,9 @@ float w_nex(float req)
                        NEX_SETTINGS(WEP_SKIPCVAR, WEP_SET_PROP)
                        return TRUE;
                }
-               case WR_SETUP:
-               {
-                       self.current_ammo = ammo_cells;
-                       return TRUE;
-               }
                case WR_CHECKAMMO1:
                {
-                       ammo_amount = self.ammo_cells >= WEP_CVAR_PRI(nex, ammo);
+                       ammo_amount = self.(self.current_ammo) >= WEP_CVAR_PRI(nex, ammo);
                        ammo_amount += (autocvar_g_balance_nex_reload_ammo && self.(weapon_load[WEP_NEX]) >= WEP_CVAR_PRI(nex, ammo));
                        return ammo_amount;
                }
@@ -264,7 +259,7 @@ float w_nex(float req)
                        if(WEP_CVAR(nex, secondary))
                        {
                                // don't allow charging if we don't have enough ammo
-                               ammo_amount = self.ammo_cells >= WEP_CVAR_SEC(nex, ammo);
+                               ammo_amount = self.(self.current_ammo) >= WEP_CVAR_SEC(nex, ammo);
                                ammo_amount += self.(weapon_load[WEP_NEX]) >= WEP_CVAR_SEC(nex, ammo);  
                                return ammo_amount;
                        }
index e84364297cb296b57fc1722f96a1ea2ef9d7ba77..10de1ad59e96adae251283230725f2f3249944f9 100644 (file)
@@ -93,7 +93,7 @@ void W_Rifle_BulletHail_Continue()
        af = ATTACK_FINISHED(self);
        self.switchweapon = self.weapon;
        ATTACK_FINISHED(self) = time;
-       print(ftos(self.ammo_nails), "\n");
+       print(ftos(self.(self.current_ammo)), "\n");
        r = weapon_prepareattack(self.rifle_bullethail_frame == WFRAME_FIRE2, self.rifle_bullethail_refire);
        if(self.switchweapon == self.weapon)
                self.switchweapon = sw;
@@ -209,20 +209,15 @@ float W_Rifle(float req)
                        RIFLE_SETTINGS(WEP_SKIPCVAR, WEP_SET_PROP)
                        return TRUE;
                }
-               case WR_SETUP:
-               {
-                       self.current_ammo = ammo_nails;
-                       return TRUE;
-               }
                case WR_CHECKAMMO1:
                {
-                       ammo_amount = self.ammo_nails >= WEP_CVAR_PRI(rifle, ammo);
+                       ammo_amount = self.(self.current_ammo) >= WEP_CVAR_PRI(rifle, ammo);
                        ammo_amount += self.(weapon_load[WEP_RIFLE]) >= WEP_CVAR_PRI(rifle, ammo);
                        return ammo_amount;
                }
                case WR_CHECKAMMO2:
                {
-                       ammo_amount = self.ammo_nails >= WEP_CVAR_SEC(rifle, ammo);
+                       ammo_amount = self.(self.current_ammo) >= WEP_CVAR_SEC(rifle, ammo);
                        ammo_amount += self.(weapon_load[WEP_RIFLE]) >= WEP_CVAR_SEC(rifle, ammo);
                        return ammo_amount;
                }
index 04db34a6c638e867441ecb514ede68e293cce822..2153cd66410600e768b11ac8c90b63fa14c6a4b2 100644 (file)
@@ -411,7 +411,7 @@ void W_Seeker_Vollycontroller_Think() // TODO: Merge this with W_Seeker_Attack
        entity oldself,oldenemy;
        self.cnt = self.cnt - 1;
 
-       if((!(self.realowner.items & IT_UNLIMITED_AMMO) && self.realowner.ammo_rockets < WEP_CVAR(seeker, missile_ammo)) || (self.cnt <= -1) || (self.realowner.deadflag != DEAD_NO) || (self.realowner.switchweapon != WEP_SEEKER))
+       if((!(self.realowner.items & IT_UNLIMITED_AMMO) && self.realowner.(self.current_ammo) < WEP_CVAR(seeker, missile_ammo)) || (self.cnt <= -1) || (self.realowner.deadflag != DEAD_NO) || (self.realowner.switchweapon != WEP_SEEKER))
        {
                remove(self);
                return;
@@ -666,21 +666,16 @@ float W_Seeker(float req)
                        SEEKER_SETTINGS(WEP_SKIPCVAR, WEP_SET_PROP)
                        return TRUE;
                }
-               case WR_SETUP:
-               {
-                       self.current_ammo = ammo_rockets;
-                       return TRUE;
-               }
                case WR_CHECKAMMO1:
                {
                        if (WEP_CVAR(seeker, type) == 1)
                        {
-                               ammo_amount = self.ammo_rockets >= WEP_CVAR(seeker, missile_ammo);
+                               ammo_amount = self.(self.current_ammo) >= WEP_CVAR(seeker, missile_ammo);
                                ammo_amount += self.(weapon_load[WEP_SEEKER]) >= WEP_CVAR(seeker, missile_ammo);
                        }
                        else
                        {
-                               ammo_amount = self.ammo_rockets >= WEP_CVAR(seeker, tag_ammo);
+                               ammo_amount = self.(self.current_ammo) >= WEP_CVAR(seeker, tag_ammo);
                                ammo_amount += self.(weapon_load[WEP_SEEKER]) >= WEP_CVAR(seeker, tag_ammo);
                        }
                        return ammo_amount;
@@ -689,12 +684,12 @@ float W_Seeker(float req)
                {
                        if (WEP_CVAR(seeker, type) == 1)
                        {
-                               ammo_amount = self.ammo_rockets >= WEP_CVAR(seeker, tag_ammo);
+                               ammo_amount = self.(self.current_ammo) >= WEP_CVAR(seeker, tag_ammo);
                                ammo_amount += self.(weapon_load[WEP_SEEKER]) >= WEP_CVAR(seeker, tag_ammo);
                        }
                        else
                        {
-                               ammo_amount = self.ammo_rockets >= WEP_CVAR(seeker, flac_ammo);
+                               ammo_amount = self.(self.current_ammo) >= WEP_CVAR(seeker, flac_ammo);
                                ammo_amount += self.(weapon_load[WEP_SEEKER]) >= WEP_CVAR(seeker, flac_ammo);
                        }
                        return ammo_amount;