]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Rename weapon_action to WEP_ACTION
authorSamual Lenks <samual@xonotic.org>
Sat, 29 Jun 2013 03:54:20 +0000 (23:54 -0400)
committerSamual Lenks <samual@xonotic.org>
Sat, 29 Jun 2013 03:54:20 +0000 (23:54 -0400)
28 files changed:
qcsrc/common/weapons/w_arc.qc
qcsrc/common/weapons/w_blaster.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_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
qcsrc/common/weapons/w_shockwave.qc
qcsrc/common/weapons/weapons.qh
qcsrc/server/bot/havocbot/havocbot.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc
qcsrc/server/defs.qh
qcsrc/server/g_damage.qc
qcsrc/server/g_hook.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/gamemode_nexball.qc
qcsrc/server/mutators/mutator_nix.qc
qcsrc/server/t_items.qc
qcsrc/server/weapons/cl_weapons.qc
qcsrc/server/weapons/main.qc

index ab06a8a92327d9348cb25488cd0da6e5c94adf85..aef5729dc0ad47bc136fb4b99f98ea06301aa4c6 100644 (file)
@@ -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);
index e13ca5f1c192352d7e66027670441346f968410a..0221e0649bfe7c8a564c55ef56ac706cd1c47b22 100644 (file)
@@ -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))
index a8f075deab0f2383ca4bb48d5bc01fd28c726182..351babfd44a5b7724582331d9be4e5a6cb45b9e8 100644 (file)
@@ -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)
                        {
index 6815cc2f9c7e0f50bb135138fc05baf5530c0eeb..f193bbc0215a877010a2cd0a7b900c1f50e2990d 100644 (file)
@@ -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)
index ca3f364ef10bf2fd08fdf221ee9ae4ca92926244..a176070624c3a7ea85656649796df7992fcda3f3 100644 (file)
@@ -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;
                                }
                                
index 18a14fb99b2fbf5d449709aa15dd35e2b042e580..36ea83f3eeb303f909fa1d173fe5f70c711084c8 100644 (file)
@@ -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))
index 0c49744cd5a14752a4cd2651bb5e0f14f83f2371..c47b1c6da7654ba69eff2291e48a87de381a59d7 100644 (file)
@@ -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))
index 78a70dc834b2b1b94716f4e058af3afaf5b34cc9..bd0a92ce9b01e02a4de03ed1d6cd4e9f36df5478 100644 (file)
@@ -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));
index 72b57b91ea488defc51f057dbf2c1a06961110be..d6dc2650880689fb18e2ddd2118fe40d60767cf7 100644 (file)
@@ -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)
                        {
index 5f4c131452f3f236ccbbf3ece34894cd917e7766..d409ac20878d90f435ac8036f0c55e3573592b3a 100644 (file)
@@ -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))
index 6c6561ce847eefa6925c748fc8128518c1dceaca..f4b93052bd332bb9105a44347ff444988d753c55 100644 (file)
@@ -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)))
index 4b03535903b53d49a8ba6383841e4ee803e69c50..c085b1c6d8063f3e947e6c4610274fecb6fd53ac 100644 (file)
@@ -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)
index 2c45ec3f57b411076ea3d2ebd44d9685f28f564f..a3fac999b956bfbf4db94c3a18b574a8d1ab87da 100644 (file)
@@ -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))
index 95a6d608569f2f981ddd7e76e42dc6109195c793..091ce32f7bd3ef80c55b08c95301e0846819d0cb 100644 (file)
@@ -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)
                        {
index 9e8787de5ae78391a2514be940ddfc582719d9c5..61f4c7227796a0a5e931b4ab5cffcfb61952c587 100644 (file)
@@ -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
                        {
index b4d1fb7d30c84bdcc3eb73bf956208208c7b57c6..2ce6fa5d8c80defbd18302e6b42096a7f00094a3 100644 (file)
@@ -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
index 2aa6038d82fb21e640f84a7970cf18b1e2ae930c..6a4712f8ea7798632ed9e9b24a919db0c5c250c4 100644 (file)
@@ -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)
index e5133ad8868b2f64fd4598c65b74da2ee8479f79..ff3236dd753604c73f2c40bc23a080075c5e008c 100644 (file)
@@ -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;
index 68a2de343901fba60b3c926e7a9a42121cc68e69..057cc92cb91057536b60558cf1575cea797e8e8e 100644 (file)
@@ -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;
                }
        }
index fde29caf77e8be1ae01d91ca3a1a2ef49882c7ad..7f2631e4d613b9e9a337cd40dd7e4ff3bbbe3206 100644 (file)
@@ -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();
index 226e1c69ae23e5a83540d0881a6d4305df966e94..3a1fc798121867044a6d4eac5e754b44c08d226f 100644 (file)
@@ -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)
index dec6e167d1b413c074374b0d067a440591d225f1..ff7adce239892f8ac2eea2f08fd34761b6a45046 100644 (file)
@@ -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);
index cccdc8ca4d532a08899ac2429aafed815b46ad0c..2e9bd616cce7ccce524aa43127396117672e066d 100644 (file)
@@ -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);
index 78d9d707689b5ce2332287daa108aa67e00fa0b2..4f6e3d034e9d4c6d9261e0af2d1b1529d0c7b92a 100644 (file)
@@ -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);
                                
index ea450e1e6ca36941a66afa3a85ce974730510ebc..33a37c8fb08678013d45bc4d98ae7bf3af220c40 100644 (file)
@@ -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)
index 07ddfdd3c625db57296e1df77c4b0647785714e1..6600a1558c08c87454c3c44a18fac07b88b6ddd7 100644 (file)
@@ -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");
index 35d5b0664a03e301a6aec4a388bd1c0909c0c780..17475ffb8618c6861adc8a3adee9f3104d562259 100644 (file)
@@ -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);
 }
index c7b47ef31d3579abbd0ec42e516fd503bc1632f5..83f38f9b3a7cc4fd3e9d90c0f272268e0b51e98a 100644 (file)
@@ -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);