From: Samual Lenks Date: Wed, 11 Dec 2013 01:31:33 +0000 (-0500) Subject: Use .current_ammo instead of specific ammo fields X-Git-Tag: xonotic-v0.8.0~152^2~231 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=818d8304e980794193411df430b2f348cfa612c2;p=xonotic%2Fxonotic-data.pk3dir.git Use .current_ammo instead of specific ammo fields --- diff --git a/qcsrc/common/weapons/w_arc.qc b/qcsrc/common/weapons/w_arc.qc index 2f2d2ea9d..aad7bd72b 100644 --- a/qcsrc/common/weapons/w_arc.qc +++ b/qcsrc/common/weapons/w_arc.qc @@ -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: { diff --git a/qcsrc/common/weapons/w_crylink.qc b/qcsrc/common/weapons/w_crylink.qc index 63ca43a00..704b8e5b9 100644 --- a/qcsrc/common/weapons/w_crylink.qc +++ b/qcsrc/common/weapons/w_crylink.qc @@ -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; } diff --git a/qcsrc/common/weapons/w_devastator.qc b/qcsrc/common/weapons/w_devastator.qc index d10ee43a1..66bd112a8 100644 --- a/qcsrc/common/weapons/w_devastator.qc +++ b/qcsrc/common/weapons/w_devastator.qc @@ -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; } diff --git a/qcsrc/common/weapons/w_electro.qc b/qcsrc/common/weapons/w_electro.qc index 05df53a0d..d5cba995d 100644 --- a/qcsrc/common/weapons/w_electro.qc +++ b/qcsrc/common/weapons/w_electro.qc @@ -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; diff --git a/qcsrc/common/weapons/w_hagar.qc b/qcsrc/common/weapons/w_hagar.qc index 8f1b4204a..87863a194 100644 --- a/qcsrc/common/weapons/w_hagar.qc +++ b/qcsrc/common/weapons/w_hagar.qc @@ -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; } diff --git a/qcsrc/common/weapons/w_hlac.qc b/qcsrc/common/weapons/w_hlac.qc index ae21c4c33..a01b86812 100644 --- a/qcsrc/common/weapons/w_hlac.qc +++ b/qcsrc/common/weapons/w_hlac.qc @@ -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; } diff --git a/qcsrc/common/weapons/w_hook.qc b/qcsrc/common/weapons/w_hook.qc index bf9fc160e..34496f65c 100644 --- a/qcsrc/common/weapons/w_hook.qc +++ b/qcsrc/common/weapons/w_hook.qc @@ -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: { diff --git a/qcsrc/common/weapons/w_machinegun.qc b/qcsrc/common/weapons/w_machinegun.qc index db222260e..18dec54fd 100644 --- a/qcsrc/common/weapons/w_machinegun.qc +++ b/qcsrc/common/weapons/w_machinegun.qc @@ -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) { diff --git a/qcsrc/common/weapons/w_minelayer.qc b/qcsrc/common/weapons/w_minelayer.qc index a3b0f0cc1..3210f4c83 100644 --- a/qcsrc/common/weapons/w_minelayer.qc +++ b/qcsrc/common/weapons/w_minelayer.qc @@ -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; } diff --git a/qcsrc/common/weapons/w_minstanex.qc b/qcsrc/common/weapons/w_minstanex.qc index f42a58153..007825c19 100644 --- a/qcsrc/common/weapons/w_minstanex.qc +++ b/qcsrc/common/weapons/w_minstanex.qc @@ -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; } diff --git a/qcsrc/common/weapons/w_mortar.qc b/qcsrc/common/weapons/w_mortar.qc index c25b4e389..b5d7a93a3 100644 --- a/qcsrc/common/weapons/w_mortar.qc +++ b/qcsrc/common/weapons/w_mortar.qc @@ -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; } diff --git a/qcsrc/common/weapons/w_nex.qc b/qcsrc/common/weapons/w_nex.qc index 7710fcced..9a7a423be 100644 --- a/qcsrc/common/weapons/w_nex.qc +++ b/qcsrc/common/weapons/w_nex.qc @@ -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; } diff --git a/qcsrc/common/weapons/w_rifle.qc b/qcsrc/common/weapons/w_rifle.qc index e84364297..10de1ad59 100644 --- a/qcsrc/common/weapons/w_rifle.qc +++ b/qcsrc/common/weapons/w_rifle.qc @@ -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; } diff --git a/qcsrc/common/weapons/w_seeker.qc b/qcsrc/common/weapons/w_seeker.qc index 04db34a6c..2153cd664 100644 --- a/qcsrc/common/weapons/w_seeker.qc +++ b/qcsrc/common/weapons/w_seeker.qc @@ -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;