From d54a47a632232b852c09ecbf9c12b8011c5d8f80 Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Fri, 28 Jun 2013 23:54:20 -0400 Subject: [PATCH] Rename weapon_action to WEP_ACTION --- qcsrc/common/weapons/w_arc.qc | 2 +- qcsrc/common/weapons/w_blaster.qc | 2 +- qcsrc/common/weapons/w_crylink.qc | 2 +- qcsrc/common/weapons/w_devastator.qc | 2 +- qcsrc/common/weapons/w_electro.qc | 4 ++-- qcsrc/common/weapons/w_hagar.qc | 4 ++-- qcsrc/common/weapons/w_hlac.qc | 4 ++-- qcsrc/common/weapons/w_machinegun.qc | 8 ++++---- qcsrc/common/weapons/w_minelayer.qc | 6 +++--- qcsrc/common/weapons/w_minstanex.qc | 4 ++-- qcsrc/common/weapons/w_mortar.qc | 2 +- qcsrc/common/weapons/w_nex.qc | 2 +- qcsrc/common/weapons/w_rifle.qc | 4 ++-- qcsrc/common/weapons/w_seeker.qc | 2 +- qcsrc/common/weapons/w_shockwave.qc | 2 +- qcsrc/common/weapons/weapons.qh | 2 -- qcsrc/server/bot/havocbot/havocbot.qc | 4 ++-- qcsrc/server/cl_client.qc | 2 +- qcsrc/server/cl_player.qc | 4 ++-- qcsrc/server/defs.qh | 2 +- qcsrc/server/g_damage.qc | 2 +- qcsrc/server/g_hook.qc | 2 +- qcsrc/server/miscfunctions.qc | 2 +- qcsrc/server/mutators/gamemode_nexball.qc | 4 ++-- qcsrc/server/mutators/mutator_nix.qc | 6 +++--- qcsrc/server/t_items.qc | 6 +++--- qcsrc/server/weapons/cl_weapons.qc | 12 ++++++------ qcsrc/server/weapons/main.qc | 10 +++++----- 28 files changed, 53 insertions(+), 55 deletions(-) diff --git a/qcsrc/common/weapons/w_arc.qc b/qcsrc/common/weapons/w_arc.qc index ab06a8a92..aef5729dc 100644 --- a/qcsrc/common/weapons/w_arc.qc +++ b/qcsrc/common/weapons/w_arc.qc @@ -287,7 +287,7 @@ float w_arc(float req) void ArcInit() { - weapon_action(WEP_ARC, WR_PRECACHE); + WEP_ACTION(WEP_ARC, WR_PRECACHE); arc_shotorigin[0] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC), FALSE, FALSE, 1); arc_shotorigin[1] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC), FALSE, FALSE, 2); arc_shotorigin[2] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC), FALSE, FALSE, 3); diff --git a/qcsrc/common/weapons/w_blaster.qc b/qcsrc/common/weapons/w_blaster.qc index e13ca5f1c..0221e0649 100644 --- a/qcsrc/common/weapons/w_blaster.qc +++ b/qcsrc/common/weapons/w_blaster.qc @@ -449,7 +449,7 @@ float W_Laser(float request) case WR_THINK: { if(autocvar_g_balance_laser_reload_ammo && self.clip_load < 1) // forced reload - weapon_action(self.weapon, WR_RELOAD); + WEP_ACTION(self.weapon, WR_RELOAD); else if(self.BUTTON_ATCK) { if(weapon_prepareattack(0, autocvar_g_balance_laser_primary_refire)) diff --git a/qcsrc/common/weapons/w_crylink.qc b/qcsrc/common/weapons/w_crylink.qc index a8f075dea..351babfd4 100644 --- a/qcsrc/common/weapons/w_crylink.qc +++ b/qcsrc/common/weapons/w_crylink.qc @@ -572,7 +572,7 @@ float w_crylink(float req) case WR_THINK: { if(autocvar_g_balance_crylink_reload_ammo && self.clip_load < min(autocvar_g_balance_crylink_primary_ammo, autocvar_g_balance_crylink_secondary_ammo)) // forced reload - weapon_action(self.weapon, WR_RELOAD); + WEP_ACTION(self.weapon, WR_RELOAD); if (self.BUTTON_ATCK) { diff --git a/qcsrc/common/weapons/w_devastator.qc b/qcsrc/common/weapons/w_devastator.qc index 6815cc2f9..f193bbc02 100644 --- a/qcsrc/common/weapons/w_devastator.qc +++ b/qcsrc/common/weapons/w_devastator.qc @@ -417,7 +417,7 @@ float W_Devastator(float req) case WR_THINK: { if(WEP_CVAR(devastator, reload_ammo) && self.clip_load < WEP_CVAR(devastator, ammo)) // forced reload - weapon_action(self.weapon, WR_RELOAD); + WEP_ACTION(self.weapon, WR_RELOAD); else { if (self.BUTTON_ATCK) diff --git a/qcsrc/common/weapons/w_electro.qc b/qcsrc/common/weapons/w_electro.qc index ca3f364ef..a17607062 100644 --- a/qcsrc/common/weapons/w_electro.qc +++ b/qcsrc/common/weapons/w_electro.qc @@ -368,7 +368,7 @@ void W_Electro_Attack3 (void) void ElectroInit() { - weapon_action(WEP_ELECTRO, WR_PRECACHE); + WEP_ACTION(WEP_ELECTRO, WR_PRECACHE); electro_shotorigin[0] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ELECTRO), FALSE, FALSE, 1); electro_shotorigin[1] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ELECTRO), FALSE, FALSE, 2); electro_shotorigin[2] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ELECTRO), FALSE, FALSE, 3); @@ -446,7 +446,7 @@ float w_electro(float req) if(!ammo_amount) { - weapon_action(self.weapon, WR_RELOAD); + WEP_ACTION(self.weapon, WR_RELOAD); return FALSE; } diff --git a/qcsrc/common/weapons/w_hagar.qc b/qcsrc/common/weapons/w_hagar.qc index 18a14fb99..36ea83f3e 100644 --- a/qcsrc/common/weapons/w_hagar.qc +++ b/qcsrc/common/weapons/w_hagar.qc @@ -338,7 +338,7 @@ void W_Hagar_Attack2_Load (void) } // we aren't checking ammo during an attack, so we must do it here - if not(weapon_action(self.weapon, WR_CHECKAMMO1) + weapon_action(self.weapon, WR_CHECKAMMO2)) + if not(WEP_ACTION(self.weapon, WR_CHECKAMMO1) + WEP_ACTION(self.weapon, WR_CHECKAMMO2)) { // note: this doesn't force the switch W_SwitchToOtherWeapon(self); @@ -368,7 +368,7 @@ float w_hagar(float req) if (loadable_secondary) W_Hagar_Attack2_Load(); // must always run each frame if(autocvar_g_balance_hagar_reload_ammo && self.clip_load < min(autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_secondary_ammo)) // forced reload - weapon_action(self.weapon, WR_RELOAD); + WEP_ACTION(self.weapon, WR_RELOAD); else if (self.BUTTON_ATCK && !self.hagar_load && !self.hagar_loadblock) // not while secondary is loaded or awaiting reset { if (weapon_prepareattack(0, autocvar_g_balance_hagar_primary_refire)) diff --git a/qcsrc/common/weapons/w_hlac.qc b/qcsrc/common/weapons/w_hlac.qc index 0c49744cd..c47b1c6da 100644 --- a/qcsrc/common/weapons/w_hlac.qc +++ b/qcsrc/common/weapons/w_hlac.qc @@ -148,7 +148,7 @@ void HLAC_fire1_02() if (self.BUTTON_ATCK) { - if (!weapon_action(self.weapon, WR_CHECKAMMO1)) + if (!WEP_ACTION(self.weapon, WR_CHECKAMMO1)) if not(self.items & IT_UNLIMITED_WEAPON_AMMO) { W_SwitchWeapon_Force(self, w_getbestweapon(self)); @@ -180,7 +180,7 @@ float w_hlac(float req) case WR_THINK: { if(autocvar_g_balance_hlac_reload_ammo && self.clip_load < min(autocvar_g_balance_hlac_primary_ammo, autocvar_g_balance_hlac_secondary_ammo)) // forced reload - weapon_action(self.weapon, WR_RELOAD); + WEP_ACTION(self.weapon, WR_RELOAD); else if (self.BUTTON_ATCK) { if (weapon_prepareattack(0, autocvar_g_balance_hlac_primary_refire)) diff --git a/qcsrc/common/weapons/w_machinegun.qc b/qcsrc/common/weapons/w_machinegun.qc index 78a70dc83..bd0a92ce9 100644 --- a/qcsrc/common/weapons/w_machinegun.qc +++ b/qcsrc/common/weapons/w_machinegun.qc @@ -105,7 +105,7 @@ void uzi_fire1_02() } if (self.BUTTON_ATCK) { - if (!weapon_action(self.weapon, WR_CHECKAMMO2)) + if (!WEP_ACTION(self.weapon, WR_CHECKAMMO2)) if not(self.items & IT_UNLIMITED_WEAPON_AMMO) { W_SwitchWeapon_Force(self, w_getbestweapon(self)); @@ -131,7 +131,7 @@ void uzi_mode1_fire_auto() return; } - if (!weapon_action(self.weapon, WR_CHECKAMMO1)) + if (!WEP_ACTION(self.weapon, WR_CHECKAMMO1)) if not(self.items & IT_UNLIMITED_WEAPON_AMMO) { W_SwitchWeapon_Force(self, w_getbestweapon(self)); @@ -217,7 +217,7 @@ float w_uzi(float req) case WR_THINK: { if(autocvar_g_balance_uzi_reload_ammo && self.clip_load < min(max(autocvar_g_balance_uzi_sustained_ammo, autocvar_g_balance_uzi_first_ammo), autocvar_g_balance_uzi_burst_ammo)) // forced reload - weapon_action(self.weapon, WR_RELOAD); + WEP_ACTION(self.weapon, WR_RELOAD); else if(autocvar_g_balance_uzi_mode == 1) { if (self.BUTTON_ATCK) @@ -230,7 +230,7 @@ float w_uzi(float req) if(self.BUTTON_ATCK2) if(weapon_prepareattack(1, 0)) { - if (!weapon_action(self.weapon, WR_CHECKAMMO2)) + if (!WEP_ACTION(self.weapon, WR_CHECKAMMO2)) if not(self.items & IT_UNLIMITED_WEAPON_AMMO) { W_SwitchWeapon_Force(self, w_getbestweapon(self)); diff --git a/qcsrc/common/weapons/w_minelayer.qc b/qcsrc/common/weapons/w_minelayer.qc index 72b57b91e..d6dc26508 100644 --- a/qcsrc/common/weapons/w_minelayer.qc +++ b/qcsrc/common/weapons/w_minelayer.qc @@ -88,7 +88,7 @@ void W_Mine_Explode () entity oldself; oldself = self; self = self.realowner; - if (!weapon_action(WEP_MINE_LAYER, WR_CHECKAMMO1)) + if (!WEP_ACTION(WEP_MINE_LAYER, WR_CHECKAMMO1)) { self.cnt = WEP_MINE_LAYER; ATTACK_FINISHED(self) = time; @@ -115,7 +115,7 @@ void W_Mine_DoRemoteExplode () entity oldself; oldself = self; self = self.realowner; - if (!weapon_action(WEP_MINE_LAYER, WR_CHECKAMMO1)) + if (!WEP_ACTION(WEP_MINE_LAYER, WR_CHECKAMMO1)) { self.cnt = WEP_MINE_LAYER; ATTACK_FINISHED(self) = time; @@ -474,7 +474,7 @@ float w_minelayer(float req) { // not if we're holding the minelayer without enough ammo, but can detonate existing mines if not (W_PlacedMines(FALSE) && self.ammo_rockets < autocvar_g_balance_minelayer_ammo) - weapon_action(self.weapon, WR_RELOAD); + WEP_ACTION(self.weapon, WR_RELOAD); } else if (self.BUTTON_ATCK) { diff --git a/qcsrc/common/weapons/w_minstanex.qc b/qcsrc/common/weapons/w_minstanex.qc index 5f4c13145..d409ac208 100644 --- a/qcsrc/common/weapons/w_minstanex.qc +++ b/qcsrc/common/weapons/w_minstanex.qc @@ -108,9 +108,9 @@ float w_minstanex(float req) { // if the laser uses load, we also consider its ammo for reloading if(autocvar_g_balance_minstanex_reload_ammo && autocvar_g_balance_minstanex_laser_ammo && self.clip_load < min(minstanex_ammo, autocvar_g_balance_minstanex_laser_ammo)) // forced reload - weapon_action(self.weapon, WR_RELOAD); + WEP_ACTION(self.weapon, WR_RELOAD); else if(autocvar_g_balance_minstanex_reload_ammo && self.clip_load < minstanex_ammo) // forced reload - weapon_action(self.weapon, WR_RELOAD); + WEP_ACTION(self.weapon, WR_RELOAD); else if (self.BUTTON_ATCK) { if (weapon_prepareattack(0, autocvar_g_balance_minstanex_refire)) diff --git a/qcsrc/common/weapons/w_mortar.qc b/qcsrc/common/weapons/w_mortar.qc index 6c6561ce8..f4b93052b 100644 --- a/qcsrc/common/weapons/w_mortar.qc +++ b/qcsrc/common/weapons/w_mortar.qc @@ -339,7 +339,7 @@ float w_glauncher(float req) case WR_THINK: { if(autocvar_g_balance_mortar_reload_ammo && self.clip_load < min(WEP_CVAR_PRI(mortar, ammo), WEP_CVAR_SEC(mortar, ammo))) // forced reload - weapon_action(self.weapon, WR_RELOAD); + WEP_ACTION(self.weapon, WR_RELOAD); else if (self.BUTTON_ATCK) { if (weapon_prepareattack(0, WEP_CVAR_PRI(mortar, refire))) diff --git a/qcsrc/common/weapons/w_nex.qc b/qcsrc/common/weapons/w_nex.qc index 4b0353590..c085b1c6d 100644 --- a/qcsrc/common/weapons/w_nex.qc +++ b/qcsrc/common/weapons/w_nex.qc @@ -145,7 +145,7 @@ float w_nex(float req) } if(autocvar_g_balance_nex_reload_ammo && self.clip_load < min(autocvar_g_balance_nex_primary_ammo, autocvar_g_balance_nex_secondary_ammo)) // forced reload - weapon_action(self.weapon, WR_RELOAD); + WEP_ACTION(self.weapon, WR_RELOAD); else { if (self.BUTTON_ATCK) diff --git a/qcsrc/common/weapons/w_rifle.qc b/qcsrc/common/weapons/w_rifle.qc index 2c45ec3f5..a3fac999b 100644 --- a/qcsrc/common/weapons/w_rifle.qc +++ b/qcsrc/common/weapons/w_rifle.qc @@ -148,7 +148,7 @@ float w_rifle(float req) case WR_THINK: { if(autocvar_g_balance_rifle_reload_ammo && self.clip_load < min(autocvar_g_balance_rifle_primary_ammo, autocvar_g_balance_rifle_secondary_ammo)) // forced reload - weapon_action(self.weapon, WR_RELOAD); + WEP_ACTION(self.weapon, WR_RELOAD); else { self.rifle_accumulator = bound(time - autocvar_g_balance_rifle_bursttime, self.rifle_accumulator, time); @@ -165,7 +165,7 @@ float w_rifle(float req) if (autocvar_g_balance_rifle_secondary) { if(autocvar_g_balance_rifle_secondary_reload) - weapon_action(self.weapon, WR_RELOAD); + WEP_ACTION(self.weapon, WR_RELOAD); else { if (weapon_prepareattack_check(1, autocvar_g_balance_rifle_secondary_refire)) diff --git a/qcsrc/common/weapons/w_seeker.qc b/qcsrc/common/weapons/w_seeker.qc index 95a6d6085..091ce32f7 100644 --- a/qcsrc/common/weapons/w_seeker.qc +++ b/qcsrc/common/weapons/w_seeker.qc @@ -554,7 +554,7 @@ float w_seeker(float req) case WR_THINK: { if(autocvar_g_balance_seeker_reload_ammo && self.clip_load < min(autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_tag_ammo)) // forced reload - weapon_action(self.weapon, WR_RELOAD); + WEP_ACTION(self.weapon, WR_RELOAD); else if (self.BUTTON_ATCK) { diff --git a/qcsrc/common/weapons/w_shockwave.qc b/qcsrc/common/weapons/w_shockwave.qc index 9e8787de5..61f4c7227 100644 --- a/qcsrc/common/weapons/w_shockwave.qc +++ b/qcsrc/common/weapons/w_shockwave.qc @@ -208,7 +208,7 @@ float w_shotgun(float req) { // don't force reload an empty shotgun if its melee attack is active if not(autocvar_g_balance_shotgun_secondary && self.ammo_shells < autocvar_g_balance_shotgun_primary_ammo) - weapon_action(self.weapon, WR_RELOAD); + WEP_ACTION(self.weapon, WR_RELOAD); } else { diff --git a/qcsrc/common/weapons/weapons.qh b/qcsrc/common/weapons/weapons.qh index b4d1fb7d3..2ce6fa5d8 100644 --- a/qcsrc/common/weapons/weapons.qh +++ b/qcsrc/common/weapons/weapons.qh @@ -208,8 +208,6 @@ WEPSET_DECLARE_A(WEPBIT_SUPERWEAPONS); // other useful macros #define WEP_ACTION(wpn,wrequest) (get_weaponinfo(wpn)).weapon_func(wrequest) -#define weapon_action(wpn,wrequest) (get_weaponinfo(wpn)).weapon_func(wrequest) - // ===================== // Weapon Registration diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc index 2aa6038d8..6a4712f8e 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -92,7 +92,7 @@ void havocbot_ai() if(!WEPSET_EMPTY_E(self)) { - weapon_action(self.weapon, WR_AIM); + WEP_ACTION(self.weapon, WR_AIM); if (autocvar_bot_nofire || IS_INDEPENDENT_PLAYER(self)) { self.BUTTON_ATCK = FALSE; @@ -959,7 +959,7 @@ float havocbot_chooseweapon_checkreload(float new_weapon) for(i = WEP_FIRST; i <= WEP_LAST; ++i) { // if we are out of ammo for all other weapons, it's an emergency to switch to anything else - if (weapon_action(i, WR_CHECKAMMO1) + weapon_action(i, WR_CHECKAMMO2)) + if (WEP_ACTION(i, WR_CHECKAMMO1) + WEP_ACTION(i, WR_CHECKAMMO2)) other_weapon_available = TRUE; } if(other_weapon_available) diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index e5133ad88..ff3236dd7 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -558,7 +558,7 @@ void PutClientInServer (void) // reset fields the weapons may use for (j = WEP_FIRST; j <= WEP_LAST; ++j) { - weapon_action(j, WR_RESETPLAYER); + WEP_ACTION(j, WR_RESETPLAYER); // all weapons must be fully loaded when we spawn entity e; diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 68a2de343..057cc92cb 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -583,7 +583,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht frag_deathtype = deathtype; MUTATOR_CALLHOOK(PlayerDies); - weapon_action(self.weapon, WR_PLAYERDEATH); + WEP_ACTION(self.weapon, WR_PLAYERDEATH); RemoveGrapplingHook(self); @@ -683,7 +683,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht // reset fields the weapons may use just in case for (j = WEP_FIRST; j <= WEP_LAST; ++j) { - weapon_action(j, WR_RESETPLAYER); + WEP_ACTION(j, WR_RESETPLAYER); ATTACK_FINISHED_FOR(self, j) = 0; } } diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index fde29caf7..7f2631e4d 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -183,7 +183,7 @@ void setanim(entity e, vector anim, float looping, float override, float restart // WEAPONTODO .float autoswitch; -//float weapon_action(float wpn, float wrequest); +//float WEP_ACTION(float wpn, float wrequest); float client_hasweapon(entity cl, float wpn, float andammo, float complain); void w_clear(); void w_ready(); diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 226e1c69a..3a1fc7981 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -303,7 +303,7 @@ float Obituary_WeaponDeath( if(death_weapon) { w_deathtype = deathtype; - float death_message = weapon_action(death_weapon, ((murder) ? WR_KILLMESSAGE : WR_SUICIDEMESSAGE)); + float death_message = WEP_ACTION(death_weapon, ((murder) ? WR_KILLMESSAGE : WR_SUICIDEMESSAGE)); w_deathtype = FALSE; if(death_message) diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index dec6e167d..ff7adce23 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -475,7 +475,7 @@ void GrappleHookInit() } else { - weapon_action(WEP_HOOK, WR_PRECACHE); + WEP_ACTION(WEP_HOOK, WR_PRECACHE); hook_shotorigin[0] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_HOOK), FALSE, FALSE, 1); hook_shotorigin[1] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_HOOK), FALSE, FALSE, 2); hook_shotorigin[2] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_HOOK), FALSE, FALSE, 3); diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index cccdc8ca4..2e9bd616c 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -866,7 +866,7 @@ void readplayerstartcvars() { e = get_weaponinfo(i); if(WEPSET_CONTAINS_AW(start_weapons, i) || WEPSET_CONTAINS_AW(warmup_start_weapons, i)) - weapon_action(i, WR_PRECACHE); + WEP_ACTION(i, WR_PRECACHE); } start_ammo_shells = max(0, start_ammo_shells); diff --git a/qcsrc/server/mutators/gamemode_nexball.qc b/qcsrc/server/mutators/gamemode_nexball.qc index 78d9d7076..4f6e3d034 100644 --- a/qcsrc/server/mutators/gamemode_nexball.qc +++ b/qcsrc/server/mutators/gamemode_nexball.qc @@ -142,7 +142,7 @@ void GiveBall(entity plyr, entity ball) WEPSET_COPY_EE(self.weaponentity, self); self.weaponentity.switchweapon = self.weapon; WEPSET_COPY_EW(self, WEP_PORTO); - weapon_action(WEP_PORTO, WR_RESETPLAYER); + WEP_ACTION(WEP_PORTO, WR_RESETPLAYER); self.switchweapon = WEP_PORTO; W_SwitchWeapon(WEP_PORTO); self = ownr; @@ -920,7 +920,7 @@ MUTATOR_HOOKFUNCTION(nexball_PlayerPreThink) if(!WEPSET_EMPTY_E(self.weaponentity)) { WEPSET_COPY_EE(self, self.weaponentity); - weapon_action(WEP_PORTO, WR_RESETPLAYER); + WEP_ACTION(WEP_PORTO, WR_RESETPLAYER); self.switchweapon = self.weaponentity.switchweapon; W_SwitchWeapon(self.switchweapon); diff --git a/qcsrc/server/mutators/mutator_nix.qc b/qcsrc/server/mutators/mutator_nix.qc index ea450e1e6..33a37c8fb 100644 --- a/qcsrc/server/mutators/mutator_nix.qc +++ b/qcsrc/server/mutators/mutator_nix.qc @@ -60,7 +60,7 @@ void NIX_GiveCurrentWeapon() nix_nextchange = time; // start the first round now! else nix_nextchange = time + autocvar_g_balance_nix_roundtime; - //weapon_action(nix_weapon, WR_PRECACHE); // forget it, too slow + //WEP_ACTION(nix_weapon, WR_PRECACHE); // forget it, too slow } if(nix_nextchange != self.nix_lastchange_id) // this shall only be called once per round! @@ -98,7 +98,7 @@ void NIX_GiveCurrentWeapon() else Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_NIX_NEWWEAPON, nix_weapon); - weapon_action(nix_weapon, WR_RESETPLAYER); + WEP_ACTION(nix_weapon, WR_RESETPLAYER); // all weapons must be fully loaded when we spawn entity e; @@ -152,7 +152,7 @@ void NIX_precache() float i; for (i = WEP_FIRST; i <= WEP_LAST; ++i) if (NIX_CanChooseWeapon(i)) - weapon_action(i, WR_PRECACHE); + WEP_ACTION(i, WR_PRECACHE); } MUTATOR_HOOKFUNCTION(nix_ForbidThrowCurrentWeapon) diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index 07ddfdd3c..6600a1558 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -1373,7 +1373,7 @@ void spawnfunc_target_items (void) { WEPSET_OR_EW(self, j); if(self.spawnflags == 0 || self.spawnflags == 2) - weapon_action(e.weapon, WR_PRECACHE); + WEP_ACTION(e.weapon, WR_PRECACHE); break; } } @@ -1445,7 +1445,7 @@ void spawnfunc_target_items (void) e = get_weaponinfo(j); if(argv(i) == e.netname) { - weapon_action(e.weapon, WR_PRECACHE); + WEP_ACTION(e.weapon, WR_PRECACHE); break; } } @@ -1771,7 +1771,7 @@ float GiveItems(entity e, float beginarg, float endarg) POSTGIVE_WEAPON(e, j, "weapons/weaponpickup.wav", string_null); if not(WEPSET_CONTAINS_AW(save_weapons, j)) if(WEPSET_CONTAINS_EW(e, j)) - weapon_action(wi.weapon, WR_PRECACHE); + WEP_ACTION(wi.weapon, WR_PRECACHE); } } POSTGIVE_VALUE(e, strength_finished, 1, "misc/powerup.wav", "misc/poweroff.wav"); diff --git a/qcsrc/server/weapons/cl_weapons.qc b/qcsrc/server/weapons/cl_weapons.qc index 35d5b0664..17475ffb8 100644 --- a/qcsrc/server/weapons/cl_weapons.qc +++ b/qcsrc/server/weapons/cl_weapons.qc @@ -1,6 +1,6 @@ void W_TriggerReload() { - weapon_action(self.weapon, WR_RELOAD); + WEP_ACTION(self.weapon, WR_RELOAD); } // switch between weapons @@ -153,7 +153,7 @@ float w_getbestweapon(entity e) // generic weapons table // TODO should they be macros instead? -//float weapon_action(float wpn, float wrequest) +//float WEP_ACTION(float wpn, float wrequest) //{ // return (get_weaponinfo(wpn)).weapon_func(wrequest); //} @@ -407,7 +407,7 @@ void W_WeaponFrame() //setanim(self, self.anim_draw, FALSE, TRUE, TRUE); self.weaponentity.state = WS_RAISE; - weapon_action(self.switchweapon, WR_SETUP); + WEP_ACTION(self.switchweapon, WR_SETUP); // set our clip load to the load of the weapon we switched to, if it's reloadable if(newwep.spawnflags & WEP_FLAG_RELOADABLE && cvar(strcat("g_balance_", newwep.netname, "_reload_ammo"))) // prevent accessing undefined cvars @@ -479,9 +479,9 @@ void W_WeaponFrame() v_up = up; if(w) - weapon_action(self.weapon, WR_THINK); + WEP_ACTION(self.weapon, WR_THINK); else - weapon_action(self.weapon, WR_GONETHINK); + WEP_ACTION(self.weapon, WR_GONETHINK); if (time + self.weapon_frametime * 0.5 >= self.weapon_nextthink) { @@ -662,5 +662,5 @@ void weapon_defaultspawnfunc(float wpn) StartItem(e.model, "weapons/weaponpickup.wav", self.respawntime, self.respawntimejitter, e.message, 0, e.weapon, f, weapon_pickupevalfunc, e.bot_pickupbasevalue); if (self.modelindex) // don't precache if self was removed - weapon_action(e.weapon, WR_PRECACHE); + WEP_ACTION(e.weapon, WR_PRECACHE); } diff --git a/qcsrc/server/weapons/main.qc b/qcsrc/server/weapons/main.qc index c7b47ef31..83f38f9b3 100644 --- a/qcsrc/server/weapons/main.qc +++ b/qcsrc/server/weapons/main.qc @@ -613,8 +613,8 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain) { oldself = self; self = cl; - f = weapon_action(wpn, WR_CHECKAMMO1); - f = f + weapon_action(wpn, WR_CHECKAMMO2); + f = WEP_ACTION(wpn, WR_CHECKAMMO1); + f = f + WEP_ACTION(wpn, WR_CHECKAMMO2); // always allow selecting the Mine Layer if we placed mines, so that we can detonate them entity mine; @@ -741,7 +741,7 @@ void W_SwitchToOtherWeapon(entity pl) float weapon_prepareattack_checkammo(float secondary) { if not(self.items & IT_UNLIMITED_WEAPON_AMMO) - if (!weapon_action(self.weapon, WR_CHECKAMMO1 + secondary)) + if (!WEP_ACTION(self.weapon, WR_CHECKAMMO1 + secondary)) { // always keep the Mine Layer if we placed mines, so that we can detonate them entity mine; @@ -755,7 +755,7 @@ float weapon_prepareattack_checkammo(float secondary) self.prevdryfire = time; } - if(weapon_action(self.weapon, WR_CHECKAMMO2 - secondary)) // check if the other firing mode has enough ammo + if(WEP_ACTION(self.weapon, WR_CHECKAMMO2 - secondary)) // check if the other firing mode has enough ammo { if(time - self.prevwarntime > 1) { @@ -1101,7 +1101,7 @@ void W_Reload(float sent_ammo_min, float sent_ammo_amount, float sent_time, stri self.reload_complain = time + 1; } // switch away if the amount of ammo is not enough to keep using this weapon - if not(weapon_action(self.weapon, WR_CHECKAMMO1) + weapon_action(self.weapon, WR_CHECKAMMO2)) + if not(WEP_ACTION(self.weapon, WR_CHECKAMMO1) + WEP_ACTION(self.weapon, WR_CHECKAMMO2)) { self.clip_load = -1; // reload later W_SwitchToOtherWeapon(self); -- 2.39.2