From 6f1eceabac55a7242bc13401a91c249c2ea5e989 Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Wed, 1 Jan 2014 19:46:57 -0500 Subject: [PATCH] Remove duplicate WEP_ prefix for WEP_AMMO usage --- qcsrc/common/weapons/w_arc.qc | 10 +++++----- qcsrc/common/weapons/w_crylink.qc | 4 ++-- qcsrc/common/weapons/w_devastator.qc | 8 ++++---- qcsrc/common/weapons/w_electro.qc | 6 +++--- qcsrc/common/weapons/w_hagar.qc | 6 +++--- qcsrc/common/weapons/w_hlac.qc | 4 ++-- qcsrc/common/weapons/w_machinegun.qc | 8 ++++---- qcsrc/common/weapons/w_minelayer.qc | 4 ++-- qcsrc/common/weapons/w_mortar.qc | 4 ++-- qcsrc/common/weapons/w_rifle.qc | 6 +++--- qcsrc/common/weapons/w_seeker.qc | 10 +++++----- qcsrc/common/weapons/w_vaporizer.qc | 8 ++++---- qcsrc/common/weapons/w_vortex.qc | 8 ++++---- qcsrc/common/weapons/weapons.qh | 2 +- 14 files changed, 44 insertions(+), 44 deletions(-) diff --git a/qcsrc/common/weapons/w_arc.qc b/qcsrc/common/weapons/w_arc.qc index 83285d5f4..62bf5dd00 100644 --- a/qcsrc/common/weapons/w_arc.qc +++ b/qcsrc/common/weapons/w_arc.qc @@ -79,7 +79,7 @@ void W_Arc_Beam_Think() remove(self); return; } - if (self.owner.weaponentity.state != WS_INUSE || (self.owner.WEP_AMMO(WEP_ARC) <= 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.WEP_AMMO(ARC) <= 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; @@ -97,8 +97,8 @@ void W_Arc_Beam_Think() { if(WEP_CVAR_PRI(arc, ammo)) { - dt = min(dt, self.owner.WEP_AMMO(WEP_ARC) / WEP_CVAR_PRI(arc, ammo)); - self.owner.WEP_AMMO(WEP_ARC) = max(0, self.owner.WEP_AMMO(WEP_ARC) - WEP_CVAR_PRI(arc, ammo) * frametime); + dt = min(dt, self.owner.WEP_AMMO(ARC) / WEP_CVAR_PRI(arc, ammo)); + self.owner.WEP_AMMO(ARC) = max(0, self.owner.WEP_AMMO(ARC) - WEP_CVAR_PRI(arc, ammo) * frametime); } } @@ -254,11 +254,11 @@ float W_Arc(float req) } case WR_CHECKAMMO1: { - return !WEP_CVAR_PRI(arc, ammo) || (self.WEP_AMMO(WEP_ARC) > 0); + return !WEP_CVAR_PRI(arc, ammo) || (self.WEP_AMMO(ARC) > 0); } case WR_CHECKAMMO2: { - return self.WEP_AMMO(WEP_ARC) >= WEP_CVAR_SEC(arc, ammo); + return self.WEP_AMMO(ARC) >= 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 5d3803834..c2f6b49de 100644 --- a/qcsrc/common/weapons/w_crylink.qc +++ b/qcsrc/common/weapons/w_crylink.qc @@ -648,7 +648,7 @@ float W_Crylink(float req) if(self.crylink_lastgroup && self.crylink_waitrelease) return TRUE; - ammo_amount = self.WEP_AMMO(WEP_CRYLINK) >= WEP_CVAR_PRI(crylink, ammo); + ammo_amount = self.WEP_AMMO(CRYLINK) >= WEP_CVAR_PRI(crylink, ammo); ammo_amount += self.(weapon_load[WEP_CRYLINK]) >= WEP_CVAR_PRI(crylink, ammo); return ammo_amount; } @@ -658,7 +658,7 @@ float W_Crylink(float req) if(self.crylink_lastgroup && self.crylink_waitrelease) return TRUE; - ammo_amount = self.WEP_AMMO(WEP_CRYLINK) >= WEP_CVAR_SEC(crylink, ammo); + ammo_amount = self.WEP_AMMO(CRYLINK) >= 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 dcdbe3894..7298ded15 100644 --- a/qcsrc/common/weapons/w_devastator.qc +++ b/qcsrc/common/weapons/w_devastator.qc @@ -82,7 +82,7 @@ void W_Devastator_Explode() if (self.realowner.weapon == WEP_DEVASTATOR) { - if(self.realowner.WEP_AMMO(WEP_DEVASTATOR) < WEP_CVAR(devastator, ammo)) + if(self.realowner.WEP_AMMO(DEVASTATOR) < WEP_CVAR(devastator, ammo)) { self.realowner.cnt = WEP_DEVASTATOR; ATTACK_FINISHED(self.realowner) = time; @@ -103,7 +103,7 @@ void W_Devastator_DoRemoteExplode() if (self.realowner.weapon == WEP_DEVASTATOR) { - if(self.realowner.WEP_AMMO(WEP_DEVASTATOR) < WEP_CVAR(devastator, ammo)) + if(self.realowner.WEP_AMMO(DEVASTATOR) < WEP_CVAR(devastator, ammo)) { self.realowner.cnt = WEP_DEVASTATOR; ATTACK_FINISHED(self.realowner) = time; @@ -415,10 +415,10 @@ float W_Devastator(float req) ammo_amount = FALSE; if(WEP_CVAR(devastator, reload_ammo)) { - if(self.WEP_AMMO(WEP_DEVASTATOR) < WEP_CVAR(devastator, ammo) && self.(weapon_load[WEP_DEVASTATOR]) < WEP_CVAR(devastator, ammo)) + if(self.WEP_AMMO(DEVASTATOR) < WEP_CVAR(devastator, ammo) && self.(weapon_load[WEP_DEVASTATOR]) < WEP_CVAR(devastator, ammo)) ammo_amount = TRUE; } - else if(self.WEP_AMMO(WEP_DEVASTATOR) < WEP_CVAR(devastator, ammo)) + else if(self.WEP_AMMO(DEVASTATOR) < 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 491e951d3..6fb5e7bdc 100644 --- a/qcsrc/common/weapons/w_electro.qc +++ b/qcsrc/common/weapons/w_electro.qc @@ -488,7 +488,7 @@ float W_Electro(float req) } case WR_CHECKAMMO1: { - ammo_amount = self.WEP_AMMO(WEP_ELECTRO) >= WEP_CVAR_PRI(electro, ammo); + ammo_amount = self.WEP_AMMO(ELECTRO) >= WEP_CVAR_PRI(electro, ammo); ammo_amount += self.(weapon_load[WEP_ELECTRO]) >= WEP_CVAR_PRI(electro, ammo); return ammo_amount; } @@ -496,12 +496,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.WEP_AMMO(WEP_ELECTRO) >= WEP_CVAR_SEC(electro, ammo) + WEP_CVAR_PRI(electro, ammo); + ammo_amount = self.WEP_AMMO(ELECTRO) >= 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.WEP_AMMO(WEP_ELECTRO) >= WEP_CVAR_SEC(electro, ammo); + ammo_amount = self.WEP_AMMO(ELECTRO) >= 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 c68775c46..b1a8be24f 100644 --- a/qcsrc/common/weapons/w_hagar.qc +++ b/qcsrc/common/weapons/w_hagar.qc @@ -298,7 +298,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.WEP_AMMO(WEP_HAGAR) >= WEP_CVAR_SEC(hagar, ammo); + enough_ammo = self.WEP_AMMO(HAGAR) >= WEP_CVAR_SEC(hagar, ammo); if(self.BUTTON_ATCK2) { @@ -464,13 +464,13 @@ float W_Hagar(float req) } case WR_CHECKAMMO1: { - ammo_amount = self.WEP_AMMO(WEP_HAGAR) >= WEP_CVAR_PRI(hagar, ammo); + ammo_amount = self.WEP_AMMO(HAGAR) >= 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.WEP_AMMO(WEP_HAGAR) >= WEP_CVAR_SEC(hagar, ammo); + ammo_amount = self.WEP_AMMO(HAGAR) >= 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 3b969c651..eb6bfcffd 100644 --- a/qcsrc/common/weapons/w_hlac.qc +++ b/qcsrc/common/weapons/w_hlac.qc @@ -245,13 +245,13 @@ float W_HLAC(float req) } case WR_CHECKAMMO1: { - ammo_amount = self.WEP_AMMO(WEP_HLAC) >= WEP_CVAR_PRI(hlac, ammo); + ammo_amount = self.WEP_AMMO(HLAC) >= 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.WEP_AMMO(WEP_HLAC) >= WEP_CVAR_SEC(hlac, ammo); + ammo_amount = self.WEP_AMMO(HLAC) >= 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_machinegun.qc b/qcsrc/common/weapons/w_machinegun.qc index cd3b2baeb..2fd5bf27d 100644 --- a/qcsrc/common/weapons/w_machinegun.qc +++ b/qcsrc/common/weapons/w_machinegun.qc @@ -310,9 +310,9 @@ float W_MachineGun(float req) case WR_CHECKAMMO1: { if(WEP_CVAR(machinegun, mode) == 1) - ammo_amount = self.WEP_AMMO(WEP_MACHINEGUN) >= WEP_CVAR(machinegun, sustained_ammo); + ammo_amount = self.WEP_AMMO(MACHINEGUN) >= WEP_CVAR(machinegun, sustained_ammo); else - ammo_amount = self.WEP_AMMO(WEP_MACHINEGUN) >= WEP_CVAR(machinegun, first_ammo); + ammo_amount = self.WEP_AMMO(MACHINEGUN) >= WEP_CVAR(machinegun, first_ammo); if(WEP_CVAR(machinegun, reload_ammo)) { @@ -326,9 +326,9 @@ float W_MachineGun(float req) case WR_CHECKAMMO2: { if(WEP_CVAR(machinegun, mode) == 1) - ammo_amount = self.WEP_AMMO(WEP_MACHINEGUN) >= WEP_CVAR(machinegun, burst_ammo); + ammo_amount = self.WEP_AMMO(MACHINEGUN) >= WEP_CVAR(machinegun, burst_ammo); else - ammo_amount = self.WEP_AMMO(WEP_MACHINEGUN) >= WEP_CVAR(machinegun, first_ammo); + ammo_amount = self.WEP_AMMO(MACHINEGUN) >= WEP_CVAR(machinegun, first_ammo); if(WEP_CVAR(machinegun, reload_ammo)) { diff --git a/qcsrc/common/weapons/w_minelayer.qc b/qcsrc/common/weapons/w_minelayer.qc index c46120a3b..19d49b50d 100644 --- a/qcsrc/common/weapons/w_minelayer.qc +++ b/qcsrc/common/weapons/w_minelayer.qc @@ -505,7 +505,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_MineLayer_PlacedMines(FALSE) && self.WEP_AMMO(WEP_MINE_LAYER) < WEP_CVAR(minelayer, ammo))) + if(!(W_MineLayer_PlacedMines(FALSE) && self.WEP_AMMO(MINE_LAYER) < WEP_CVAR(minelayer, ammo))) WEP_ACTION(self.weapon, WR_RELOAD); } else if (self.BUTTON_ATCK) @@ -544,7 +544,7 @@ float W_MineLayer(float req) // don't switch while placing a mine if (ATTACK_FINISHED(self) <= time || self.weapon != WEP_MINE_LAYER) { - ammo_amount = self.WEP_AMMO(WEP_MINE_LAYER) >= WEP_CVAR(minelayer, ammo); + ammo_amount = self.WEP_AMMO(MINE_LAYER) >= 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_mortar.qc b/qcsrc/common/weapons/w_mortar.qc index 4737673fc..39fc9c407 100644 --- a/qcsrc/common/weapons/w_mortar.qc +++ b/qcsrc/common/weapons/w_mortar.qc @@ -416,13 +416,13 @@ float W_Mortar(float req) } case WR_CHECKAMMO1: { - ammo_amount = self.WEP_AMMO(WEP_MORTAR) >= WEP_CVAR_PRI(mortar, ammo); + ammo_amount = self.WEP_AMMO(MORTAR) >= 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.WEP_AMMO(WEP_MORTAR) >= WEP_CVAR_SEC(mortar, ammo); + ammo_amount = self.WEP_AMMO(MORTAR) >= 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_rifle.qc b/qcsrc/common/weapons/w_rifle.qc index f5a075075..530eccf71 100644 --- a/qcsrc/common/weapons/w_rifle.qc +++ b/qcsrc/common/weapons/w_rifle.qc @@ -91,7 +91,7 @@ void W_Rifle_BulletHail_Continue() af = ATTACK_FINISHED(self); self.switchweapon = self.weapon; ATTACK_FINISHED(self) = time; - print(ftos(self.WEP_AMMO(WEP_RIFLE)), "\n"); + print(ftos(self.WEP_AMMO(RIFLE)), "\n"); r = weapon_prepareattack(self.rifle_bullethail_frame == WFRAME_FIRE2, self.rifle_bullethail_refire); if(self.switchweapon == self.weapon) self.switchweapon = sw; @@ -209,13 +209,13 @@ float W_Rifle(float req) } case WR_CHECKAMMO1: { - ammo_amount = self.WEP_AMMO(WEP_RIFLE) >= WEP_CVAR_PRI(rifle, ammo); + ammo_amount = self.WEP_AMMO(RIFLE) >= 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.WEP_AMMO(WEP_RIFLE) >= WEP_CVAR_SEC(rifle, ammo); + ammo_amount = self.WEP_AMMO(RIFLE) >= 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 b6221538a..943734b7b 100644 --- a/qcsrc/common/weapons/w_seeker.qc +++ b/qcsrc/common/weapons/w_seeker.qc @@ -412,7 +412,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.WEP_AMMO(WEP_SEEKER) < 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.WEP_AMMO(SEEKER) < WEP_CVAR(seeker, missile_ammo)) || (self.cnt <= -1) || (self.realowner.deadflag != DEAD_NO) || (self.realowner.switchweapon != WEP_SEEKER)) { remove(self); return; @@ -671,12 +671,12 @@ float W_Seeker(float req) { if (WEP_CVAR(seeker, type) == 1) { - ammo_amount = self.WEP_AMMO(WEP_SEEKER) >= WEP_CVAR(seeker, missile_ammo); + ammo_amount = self.WEP_AMMO(SEEKER) >= WEP_CVAR(seeker, missile_ammo); ammo_amount += self.(weapon_load[WEP_SEEKER]) >= WEP_CVAR(seeker, missile_ammo); } else { - ammo_amount = self.WEP_AMMO(WEP_SEEKER) >= WEP_CVAR(seeker, tag_ammo); + ammo_amount = self.WEP_AMMO(SEEKER) >= WEP_CVAR(seeker, tag_ammo); ammo_amount += self.(weapon_load[WEP_SEEKER]) >= WEP_CVAR(seeker, tag_ammo); } return ammo_amount; @@ -685,12 +685,12 @@ float W_Seeker(float req) { if (WEP_CVAR(seeker, type) == 1) { - ammo_amount = self.WEP_AMMO(WEP_SEEKER) >= WEP_CVAR(seeker, tag_ammo); + ammo_amount = self.WEP_AMMO(SEEKER) >= WEP_CVAR(seeker, tag_ammo); ammo_amount += self.(weapon_load[WEP_SEEKER]) >= WEP_CVAR(seeker, tag_ammo); } else { - ammo_amount = self.WEP_AMMO(WEP_SEEKER) >= WEP_CVAR(seeker, flac_ammo); + ammo_amount = self.WEP_AMMO(SEEKER) >= WEP_CVAR(seeker, flac_ammo); ammo_amount += self.(weapon_load[WEP_SEEKER]) >= WEP_CVAR(seeker, flac_ammo); } return ammo_amount; diff --git a/qcsrc/common/weapons/w_vaporizer.qc b/qcsrc/common/weapons/w_vaporizer.qc index 66510bc1c..7ef66ab58 100644 --- a/qcsrc/common/weapons/w_vaporizer.qc +++ b/qcsrc/common/weapons/w_vaporizer.qc @@ -122,7 +122,7 @@ float W_Vaporizer(float req) { case WR_AIM: { - if(self.WEP_AMMO(WEP_VAPORIZER) > 0) + if(self.WEP_AMMO(VAPORIZER) > 0) self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE); else self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), FALSE); // WEAPONTODO: replace with proper vaporizer cvars @@ -196,13 +196,13 @@ float W_Vaporizer(float req) } case WR_SETUP: { - self.ammo_field = WEP_AMMO(WEP_VAPORIZER); + self.ammo_field = WEP_AMMO(VAPORIZER); self.vaporizer_lasthit = 0; return TRUE; } case WR_CHECKAMMO1: { - ammo_amount = self.WEP_AMMO(WEP_VAPORIZER) >= vaporizer_ammo; + ammo_amount = self.WEP_AMMO(VAPORIZER) >= vaporizer_ammo; ammo_amount += self.(weapon_load[WEP_VAPORIZER]) >= vaporizer_ammo; return ammo_amount; } @@ -210,7 +210,7 @@ float W_Vaporizer(float req) { if(!WEP_CVAR_SEC(vaporizer, ammo)) return TRUE; - ammo_amount = self.WEP_AMMO(WEP_VAPORIZER) >= WEP_CVAR_SEC(vaporizer, ammo); + ammo_amount = self.WEP_AMMO(VAPORIZER) >= WEP_CVAR_SEC(vaporizer, ammo); ammo_amount += self.(weapon_load[WEP_VAPORIZER]) >= WEP_CVAR_SEC(vaporizer, ammo); return ammo_amount; } diff --git a/qcsrc/common/weapons/w_vortex.qc b/qcsrc/common/weapons/w_vortex.qc index 019d81293..c1bda8400 100644 --- a/qcsrc/common/weapons/w_vortex.qc +++ b/qcsrc/common/weapons/w_vortex.qc @@ -204,11 +204,11 @@ float W_Vortex(float req) } else { - dt = min(dt, (self.WEP_AMMO(WEP_VORTEX) - WEP_CVAR_PRI(vortex, ammo)) / WEP_CVAR_SEC(vortex, ammo)); + dt = min(dt, (self.WEP_AMMO(VORTEX) - WEP_CVAR_PRI(vortex, ammo)) / WEP_CVAR_SEC(vortex, ammo)); dt = max(0, dt); if(dt > 0) { - self.WEP_AMMO(WEP_VORTEX) = max(WEP_CVAR_SEC(vortex, ammo), self.WEP_AMMO(WEP_VORTEX) - WEP_CVAR_SEC(vortex, ammo) * dt); + self.WEP_AMMO(VORTEX) = max(WEP_CVAR_SEC(vortex, ammo), self.WEP_AMMO(VORTEX) - WEP_CVAR_SEC(vortex, ammo) * dt); } } } @@ -252,7 +252,7 @@ float W_Vortex(float req) } case WR_CHECKAMMO1: { - ammo_amount = self.WEP_AMMO(WEP_VORTEX) >= WEP_CVAR_PRI(vortex, ammo); + ammo_amount = self.WEP_AMMO(VORTEX) >= WEP_CVAR_PRI(vortex, ammo); ammo_amount += (autocvar_g_balance_vortex_reload_ammo && self.(weapon_load[WEP_VORTEX]) >= WEP_CVAR_PRI(vortex, ammo)); return ammo_amount; } @@ -261,7 +261,7 @@ float W_Vortex(float req) if(WEP_CVAR(vortex, secondary)) { // don't allow charging if we don't have enough ammo - ammo_amount = self.WEP_AMMO(WEP_VORTEX) >= WEP_CVAR_SEC(vortex, ammo); + ammo_amount = self.WEP_AMMO(VORTEX) >= WEP_CVAR_SEC(vortex, ammo); ammo_amount += self.(weapon_load[WEP_VORTEX]) >= WEP_CVAR_SEC(vortex, ammo); return ammo_amount; } diff --git a/qcsrc/common/weapons/weapons.qh b/qcsrc/common/weapons/weapons.qh index e0a4a5b7e..3f45eb5a9 100644 --- a/qcsrc/common/weapons/weapons.qh +++ b/qcsrc/common/weapons/weapons.qh @@ -89,7 +89,7 @@ float GetAmmoStat(.float ammotype); // other useful macros #define WEP_ACTION(wpn,wrequest) (get_weaponinfo(wpn)).weapon_func(wrequest) -#define WEP_AMMO(wpn) ((get_weaponinfo(wpn)).ammo_field) +#define WEP_AMMO(wpn) ((get_weaponinfo(WEP_##wpn)).ammo_field) // ====================== -- 2.39.2