]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
s/WEP_(ID)/WEP_$1.m_id/
authorTimePath <andrew.hardaker1995@gmail.com>
Fri, 14 Aug 2015 09:50:48 +0000 (19:50 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Fri, 14 Aug 2015 09:50:48 +0000 (19:50 +1000)
47 files changed:
qcsrc/Makefile
qcsrc/client/damage.qc
qcsrc/client/view.qc
qcsrc/common/monsters/monster/shambler.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/physics.qc
qcsrc/common/weapons/all.qh
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_fireball.qc
qcsrc/common/weapons/w_hagar.qc
qcsrc/common/weapons/w_hlac.qc
qcsrc/common/weapons/w_hmg.qc
qcsrc/common/weapons/w_hook.qc
qcsrc/common/weapons/w_machinegun.qc
qcsrc/common/weapons/w_minelayer.qc
qcsrc/common/weapons/w_mortar.qc
qcsrc/common/weapons/w_porto.qc
qcsrc/common/weapons/w_rifle.qc
qcsrc/common/weapons/w_rpc.qc
qcsrc/common/weapons/w_seeker.qc
qcsrc/common/weapons/w_shockwave.qc
qcsrc/common/weapons/w_shotgun.qc
qcsrc/common/weapons/w_tuba.qc
qcsrc/common/weapons/w_vaporizer.qc
qcsrc/common/weapons/w_vortex.qc
qcsrc/server/bot/havocbot/havocbot.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_hook.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/gamemode_nexball.qc
qcsrc/server/mutators/mutator_buffs.qc
qcsrc/server/mutators/mutator_instagib.qc
qcsrc/server/mutators/mutator_nades.qc
qcsrc/server/mutators/mutator_new_toys.qc
qcsrc/server/mutators/mutator_nix.qc
qcsrc/server/mutators/mutator_overkill.qc
qcsrc/server/vehicles/vehicle.qc
qcsrc/server/weapons/selection.qc
qcsrc/server/weapons/throwing.qc
qcsrc/server/weapons/tracing.qc
qcsrc/server/weapons/weaponsystem.qc

index f53707e829f482c39e0f6dcdee0c54d54d4aa3c1..26797c55a1459fd67fe9599f97158d3707a4f7e4 100644 (file)
@@ -13,7 +13,7 @@ QCCFLAGS ?= \
        -std=gmqcc \
        -O3 -flno \
        -Werror -fno-bail-on-werror -Wall \
-       -fftepp -fftepp-predefs -Wcpp -futf8 \
+       -fftepp -fftepp-predefs -Wcpp -futf8 -frelaxed-switch \
        $(QCCFLAGS_WTFS) \
        $(QCCFLAGS_FEATURES) \
        $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
index 3626c44c617408555c5bb4c4eaede028fe6399db..70df439efe928def46c66cb03e53f15169deb8eb 100644 (file)
@@ -357,7 +357,7 @@ void Ent_DamageInfo(float isNew)
                w_random = prandom();
 
                traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, world);
-               if(trace_fraction < 1 && hitwep != WEP_VORTEX && hitwep != WEP_VAPORIZER)
+               if(trace_fraction < 1 && hitwep != WEP_VORTEX.m_id && hitwep != WEP_VAPORIZER.m_id)
                        w_backoff = trace_plane_normal;
                else
                        w_backoff = -1 * normalize(force);
index df8113b412c6f93aaeec1108cd12c4f96e477219..2d4bff52a114b552e1e16d133e1c92fc7617d085 100644 (file)
@@ -34,7 +34,7 @@ void Porto_Draw()
        vector p, dir, ang, q, nextdir;
        float portal_number, portal1_idx;
 
-       if(activeweapon != WEP_PORTO || spectatee_status || gametype == MAPINFO_TYPE_NEXBALL)
+       if(activeweapon != WEP_PORTO.m_id || spectatee_status || gametype == MAPINFO_TYPE_NEXBALL)
                return;
        if(g_balance_porto_secondary)
                return;
@@ -133,7 +133,7 @@ vector GetCurrentFov(float fov)
 
        zoomdir = button_zoom;
        if(hud == HUD_NORMAL)
-       if((activeweapon == WEP_VORTEX && vortex_scope) || (activeweapon == WEP_RIFLE && rifle_scope)) // do NOT use switchweapon here
+       if((activeweapon == WEP_VORTEX.m_id && vortex_scope) || (activeweapon == WEP_RIFLE.m_id && rifle_scope)) // do NOT use switchweapon here
                zoomdir += button_attack2;
        if(spectatee_status > 0 || isdemo())
        {
@@ -320,16 +320,16 @@ float TrueAimCheck()
 
        switch(activeweapon) // WEAPONTODO
        {
-               case WEP_TUBA: // no aim
-               case WEP_PORTO: // shoots from eye
-               case WEP_HOOK: // no trueaim
-               case WEP_MORTAR: // toss curve
+               case WEP_TUBA.m_id: // no aim
+               case WEP_PORTO.m_id: // shoots from eye
+               case WEP_HOOK.m_id: // no trueaim
+               case WEP_MORTAR.m_id: // toss curve
                        return SHOTTYPE_HITWORLD;
-               case WEP_VORTEX:
-               case WEP_VAPORIZER:
+               case WEP_VORTEX.m_id:
+               case WEP_VAPORIZER.m_id:
                        mv = MOVE_NORMAL;
                        break;
-               case WEP_RIFLE:
+               case WEP_RIFLE.m_id:
                        ta = trueaim_rifle;
                        mv = MOVE_NORMAL;
                        if(zoomscript_caught)
@@ -338,19 +338,19 @@ float TrueAimCheck()
                                return EnemyHitCheck();
                        }
                        break;
-               case WEP_DEVASTATOR: // projectile has a size!
+               case WEP_DEVASTATOR.m_id: // projectile has a size!
                        mi = '-3 -3 -3';
                        ma = '3 3 3';
                        break;
-               case WEP_FIREBALL: // projectile has a size!
+               case WEP_FIREBALL.m_id: // projectile has a size!
                        mi = '-16 -16 -16';
                        ma = '16 16 16';
                        break;
-               case WEP_SEEKER: // projectile has a size!
+               case WEP_SEEKER.m_id: // projectile has a size!
                        mi = '-2 -2 -2';
                        ma = '2 2 2';
                        break;
-               case WEP_ELECTRO: // projectile has a size!
+               case WEP_ELECTRO.m_id: // projectile has a size!
                        mi = '0 0 -3';
                        ma = '0 0 -3';
                        break;
@@ -439,7 +439,7 @@ bool WantEventchase()
                return true;
        if(spectatee_status >= 0)
        {
-               if(autocvar_cl_eventchase_nexball && gametype == MAPINFO_TYPE_NEXBALL && !(WepSet_GetFromStat() & WepSet_FromWeapon(WEP_PORTO)))
+               if(autocvar_cl_eventchase_nexball && gametype == MAPINFO_TYPE_NEXBALL && !(WepSet_GetFromStat() & WepSet_FromWeapon(WEP_PORTO.m_id)))
                        return true;
                if(autocvar_cl_eventchase_death && (getstati(STAT_HEALTH) <= 0))
                {
@@ -490,7 +490,7 @@ void UpdateHitsound()
 
        static float hitsound_time_prev = 0;
        // HACK: the only way to get the arc to sound consistent with pitch shift is to ignore cl_hitsound_antispam_time
-       float arc_hack = activeweapon == WEP_ARC && autocvar_cl_hitsound >= 2;
+       float arc_hack = activeweapon == WEP_ARC.m_id && autocvar_cl_hitsound >= 2;
        if (arc_hack || COMPARE_INCREASING(time, hitsound_time_prev) > autocvar_cl_hitsound_antispam_time)
        {
                if (autocvar_cl_hitsound && unaccounted_damage)
@@ -837,7 +837,7 @@ void UpdateCrosshair()
 
 
                                // handle the values
-                               if (autocvar_crosshair_ring && activeweapon == WEP_VORTEX && vortex_charge && autocvar_crosshair_ring_vortex) // ring around crosshair representing velocity-dependent damage for the vortex
+                               if (autocvar_crosshair_ring && activeweapon == WEP_VORTEX.m_id && vortex_charge && autocvar_crosshair_ring_vortex) // ring around crosshair representing velocity-dependent damage for the vortex
                                {
                                        if (vortex_chargepool || use_vortex_chargepool) {
                                                use_vortex_chargepool = 1;
@@ -857,14 +857,14 @@ void UpdateCrosshair()
                                        ring_rgb = wcross_color;
                                        ring_image = "gfx/crosshair_ring_nexgun.tga";
                                }
-                               else if (autocvar_crosshair_ring && activeweapon == WEP_MINE_LAYER && minelayer_maxmines && autocvar_crosshair_ring_minelayer)
+                               else if (autocvar_crosshair_ring && activeweapon == WEP_MINE_LAYER.m_id && minelayer_maxmines && autocvar_crosshair_ring_minelayer)
                                {
                                        ring_value = bound(0, getstati(STAT_LAYED_MINES) / minelayer_maxmines, 1); // if you later need to use the count of bullets in another place, then add a float for it. For now, no need to.
                                        ring_alpha = autocvar_crosshair_ring_minelayer_alpha;
                                        ring_rgb = wcross_color;
                                        ring_image = "gfx/crosshair_ring.tga";
                                }
-                               else if (activeweapon == WEP_HAGAR && getstati(STAT_HAGAR_LOAD) && autocvar_crosshair_ring_hagar)
+                               else if (activeweapon == WEP_HAGAR.m_id && getstati(STAT_HAGAR_LOAD) && autocvar_crosshair_ring_hagar)
                                {
                                        ring_value = bound(0, getstati(STAT_HAGAR_LOAD) / hagar_maxrockets, 1);
                                        ring_alpha = autocvar_crosshair_ring_hagar_alpha;
@@ -887,12 +887,12 @@ void UpdateCrosshair()
 
                                        // Note: This is to stop Taoki from complaining that the image doesn't match all potential balances.
                                        // if a new image for another weapon is added, add the code (and its respective file/value) here
-                                       if ((activeweapon == WEP_RIFLE) && (weapon_clipsize == 80))
+                                       if ((activeweapon == WEP_RIFLE.m_id) && (weapon_clipsize == 80))
                                                ring_image = "gfx/crosshair_ring_rifle.tga";
                                        else
                                                ring_image = "gfx/crosshair_ring.tga";
                                }
-                               else if ( autocvar_crosshair_ring && autocvar_crosshair_ring_arc && arc_heat && activeweapon == WEP_ARC )
+                               else if ( autocvar_crosshair_ring && autocvar_crosshair_ring_arc && arc_heat && activeweapon == WEP_ARC.m_id )
                                {
                                        ring_value = arc_heat;
                                        ring_alpha = (1-arc_heat)*autocvar_crosshair_ring_arc_cold_alpha +
index 986a0e10f7258618f890fe8f452ea4f023406f18..85a5fb0e7de14a0b4c5efaab6503ddd2a28bd0bf 100644 (file)
@@ -226,7 +226,7 @@ float m_shambler(float req)
                        self.monster_loot = spawnfunc_item_health_mega;
                        self.monster_attackfunc = shambler_attack;
                        self.frame = shambler_anim_stand;
-                       self.weapon = WEP_VORTEX;
+                       self.weapon = WEP_VORTEX.m_id;
 
                        return true;
                }
index 239f8fe9a7f57bf06f2f861f0544683e0774bda7..7b963bc9e56e85774e3e1c2a653a547f3e8c61cf 100644 (file)
@@ -362,7 +362,7 @@ void Monster_CheckMinibossFlag ()
                self.health += autocvar_g_monsters_miniboss_healthboost;
                self.effects |= EF_RED;
                if(!self.weapon)
-                       self.weapon = WEP_VORTEX;
+                       self.weapon = WEP_VORTEX.m_id;
        }
 }
 
index 6153d80ae7f3efb2b750979c6758741b63d5194a..a4cdc6f671c61326160e3243e0d7d673daffe61f 100644 (file)
@@ -1193,7 +1193,7 @@ void PM_check_vortex(void)
 #ifdef SVQC
        // WEAPONTODO
        float xyspeed = vlen(vec2(self.velocity));
-       if (self.weapon == WEP_VORTEX && WEP_CVAR(vortex, charge) && WEP_CVAR(vortex, charge_velocity_rate) && xyspeed > WEP_CVAR(vortex, charge_minspeed))
+       if (self.weapon == WEP_VORTEX.m_id && WEP_CVAR(vortex, charge) && WEP_CVAR(vortex, charge_velocity_rate) && xyspeed > WEP_CVAR(vortex, charge_minspeed))
        {
                // add a maximum of charge_velocity_rate when going fast (f = 1), gradually increasing from minspeed (f = 0) to maxspeed
                xyspeed = min(xyspeed, WEP_CVAR(vortex, charge_maxspeed));
index b873f8fe1c04708567515b44237c4ea98e2f97c9..1f1efd3903af313b96900cc8b3255e89704b0141 100644 (file)
@@ -68,7 +68,7 @@ WepSet ReadWepSet();
 const int WEP_FIRST = 1;
 #define WEP_MAXCOUNT 24 // Increase as needed. Can be up to three times as much.
 int WEP_COUNT;
-int WEP_LAST;
+#define WEP_LAST (WEP_FIRST + WEP_COUNT - 1)
 WepSet WEPSET_ALL;
 WepSet WEPSET_SUPERWEAPONS;
 
@@ -101,7 +101,7 @@ int GetAmmoStat(.int ammotype);
 
 // other useful macros
 #define WEP_ACTION(wpn,wrequest) (get_weaponinfo(wpn)).weapon_func(wrequest)
-#define WEP_AMMO(wpn) ((get_weaponinfo(WEP_##wpn)).ammo_field) // only used inside weapon files/with direct name, don't duplicate prefix
+#define WEP_AMMO(wpn) ((get_weaponinfo(WEP_##wpn.m_id)).ammo_field) // only used inside weapon files/with direct name, don't duplicate prefix
 #define WEP_NAME(wpn) ((get_weaponinfo(wpn)).message)
 
 
@@ -133,7 +133,7 @@ int GetAmmoStat(.int ammotype);
 
 // set initialization values for weapon settings
 #define WEP_SKIP_CVAR(unuseda,unusedb,unusedc,unusedd) /* skip cvars */
-#define WEP_SET_PROP(wepid,wepname,type,prop,name) get_weaponinfo(WEP_##wepid).##prop = autocvar_g_balance_##wepname##_##name;
+#define WEP_SET_PROP(wepid,wepname,type,prop,name) get_weaponinfo(WEP_##wepid.m_id).##prop = autocvar_g_balance_##wepname##_##name;
 
 
 // =====================
@@ -211,15 +211,14 @@ entity weapon_info[WEP_MAXCOUNT], weapon_info_first, weapon_info_last;
 entity dummy_weapon_info;
 
 #define _REGISTER_WEAPON(id, function, ammotype, impulse, flags, rating, color, modelname, simplemdl, crosshair, wepimg, refname, wepname) \
-       int WEP_##id; \
        WepSet WEPSET_##id; \
-       REGISTER(RegisterWeapons, WEP_, weapon_info, WEP_COUNT, id, m_id, \
+       REGISTER(RegisterWeapons, WEP, weapon_info, WEP_COUNT, id, m_id, \
                NEW(Weapon, function, ammotype, impulse, flags, rating, color, modelname, simplemdl, crosshair, wepimg, refname, wepname) \
        ) { \
-               WEP_LAST = (WEP_##id = WEP_FIRST + WEP_COUNT - 1); \
-               WEPSET_ALL |= (WEPSET_##id = WepSet_FromWeapon(WEP_##id)); \
+               this.m_id++; \
+               WEPSET_ALL |= (WEPSET_##id = WepSet_FromWeapon(this.m_id)); \
                if ((flags) & WEP_FLAG_SUPERWEAPON) WEPSET_SUPERWEAPONS |= WEPSET_##id; \
-               register_weapon(this, WEP_##id, WEPSET_##id); \
+               register_weapon(this, this.m_id, WEPSET_##id); \
        }
 
 bool w_null(int) { return false; }
index d661f4ebac188ff792cda3927a344e9f4f3cb8ff..7146b838685fd37b44b0ba594ab4fc04923774a7 100644 (file)
@@ -126,7 +126,7 @@ vector Draw_ArcBeam_callback_last_bottom; // NOTE: in same coordinate system as
 #endif
 #ifdef IMPLEMENTATION
 #ifdef SVQC
-void spawnfunc_weapon_arc(void) { weapon_defaultspawnfunc(WEP_ARC); }
+void spawnfunc_weapon_arc(void) { weapon_defaultspawnfunc(WEP_ARC.m_id); }
 
 float W_Arc_Beam_Send(entity to, int sf)
 {
@@ -274,7 +274,7 @@ void W_Arc_Beam_Think(void)
                if(self == self.owner.arc_beam) { self.owner.arc_beam = world; }
                entity oldself = self;
                self = self.owner;
-               if(!WEP_ACTION(WEP_ARC, WR_CHECKAMMO1) && !WEP_ACTION(WEP_ARC, WR_CHECKAMMO2))
+               if(!WEP_ACTION(WEP_ARC.m_id, WR_CHECKAMMO1) && !WEP_ACTION(WEP_ARC.m_id, WR_CHECKAMMO2))
                if(!(self.items & IT_UNLIMITED_WEAPON_AMMO))
                {
                        // note: this doesn't force the switch
@@ -531,7 +531,7 @@ void W_Arc_Beam_Think(void)
                                {
                                        accuracy_add(
                                                self.owner,
-                                               WEP_ARC,
+                                               WEP_ARC.m_id,
                                                0,
                                                rootdamage * coefficient * falloff
                                        );
@@ -542,7 +542,7 @@ void W_Arc_Beam_Think(void)
                                        self.owner,
                                        self.owner,
                                        rootdamage * coefficient * falloff,
-                                       WEP_ARC,
+                                       WEP_ARC.m_id,
                                        hitorigin,
                                        WEP_CVAR(arc, beam_force) * new_dir * coefficient * falloff
                                );
@@ -630,7 +630,7 @@ void Arc_Smoke()
        }
 
        if (  self.arc_smoke_sound && ( self.arc_overheat <= time ||
-               !( self.BUTTON_ATCK || self.BUTTON_ATCK2 ) ) || self.switchweapon != WEP_ARC )
+               !( self.BUTTON_ATCK || self.BUTTON_ATCK2 ) ) || self.switchweapon != WEP_ARC.m_id )
        {
                self.arc_smoke_sound = 0;
                sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM);
@@ -731,10 +731,10 @@ bool W_Arc(int req)
                        precache_sound("weapons/arc_loop_overheat.wav");
                        if(!arc_shotorigin[0])
                        {
-                               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);
-                               arc_shotorigin[3] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC), false, false, 4);
+                               arc_shotorigin[0] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC.m_id), false, false, 1);
+                               arc_shotorigin[1] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC.m_id), false, false, 2);
+                               arc_shotorigin[2] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC.m_id), false, false, 3);
+                               arc_shotorigin[3] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC.m_id), false, false, 4);
                        }
                        ARC_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
@@ -767,7 +767,7 @@ bool W_Arc(int req)
                }
                case WR_PICKUP:
                {
-                       if ( !client_hasweapon(self, WEP_ARC, false, false) &&
+                       if ( !client_hasweapon(self, WEP_ARC.m_id, false, false) &&
                                weapon_dropevent_item.arc_overheat > time )
                        {
                                self.arc_overheat = weapon_dropevent_item.arc_overheat;
index 2d582c6c038d93415473709f674d7f74e4864582..4576b4b2a6ccdc4035bf87417d295fc60eb9ee87 100644 (file)
@@ -48,7 +48,7 @@ BLASTER_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 #endif
 #ifdef IMPLEMENTATION
 #ifdef SVQC
-void spawnfunc_weapon_blaster(void) { weapon_defaultspawnfunc(WEP_BLASTER); }
+void spawnfunc_weapon_blaster(void) { weapon_defaultspawnfunc(WEP_BLASTER.m_id); }
 void spawnfunc_weapon_laser(void) { spawnfunc_weapon_blaster(); }
 
 void W_Blaster_Touch(void)
@@ -174,7 +174,7 @@ bool W_Blaster(int request)
                                if(weapon_prepareattack(0, WEP_CVAR_PRI(blaster, refire)))
                                {
                                        W_Blaster_Attack(
-                                               WEP_BLASTER,
+                                               WEP_BLASTER.m_id,
                                                WEP_CVAR_PRI(blaster, shotangle),
                                                WEP_CVAR_PRI(blaster, damage),
                                                WEP_CVAR_PRI(blaster, edgedamage),
@@ -194,7 +194,7 @@ bool W_Blaster(int request)
                                {
                                        case 0: // switch to last used weapon
                                        {
-                                               if(self.switchweapon == WEP_BLASTER) // don't do this if already switching
+                                               if(self.switchweapon == WEP_BLASTER.m_id) // don't do this if already switching
                                                        W_LastWeapon();
                                                break;
                                        }
@@ -204,7 +204,7 @@ bool W_Blaster(int request)
                                                if(weapon_prepareattack(1, WEP_CVAR_SEC(blaster, refire)))
                                                {
                                                        W_Blaster_Attack(
-                                                               WEP_BLASTER | HITTYPE_SECONDARY,
+                                                               WEP_BLASTER.m_id | HITTYPE_SECONDARY,
                                                                WEP_CVAR_SEC(blaster, shotangle),
                                                                WEP_CVAR_SEC(blaster, damage),
                                                                WEP_CVAR_SEC(blaster, edgedamage),
index 718dbed3147124bf75054921a031d534a9814cb9..b5e50553a2b53b51706c14dbc65bba3c329c04cd 100644 (file)
@@ -64,7 +64,7 @@ CRYLINK_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 #endif
 #ifdef IMPLEMENTATION
 #ifdef SVQC
-void spawnfunc_weapon_crylink(void) { weapon_defaultspawnfunc(WEP_CRYLINK); }
+void spawnfunc_weapon_crylink(void) { weapon_defaultspawnfunc(WEP_CRYLINK.m_id); }
 
 void W_Crylink_CheckLinks(entity e)
 {
@@ -392,7 +392,7 @@ void W_Crylink_Attack(void)
 
                proj.movetype = MOVETYPE_BOUNCEMISSILE;
                PROJECTILE_MAKETRIGGER(proj);
-               proj.projectiledeathtype = WEP_CRYLINK;
+               proj.projectiledeathtype = WEP_CRYLINK.m_id;
                //proj.gravity = 0.001;
 
                setorigin(proj, w_shotorg);
@@ -501,7 +501,7 @@ void W_Crylink_Attack2(void)
 
                proj.movetype = MOVETYPE_BOUNCEMISSILE;
                PROJECTILE_MAKETRIGGER(proj);
-               proj.projectiledeathtype = WEP_CRYLINK | HITTYPE_SECONDARY;
+               proj.projectiledeathtype = WEP_CRYLINK.m_id | HITTYPE_SECONDARY;
                //proj.gravity = 0.001;
 
                setorigin(proj, w_shotorg);
@@ -628,7 +628,7 @@ bool W_Crylink(int req)
                                        if(!(self.items & IT_UNLIMITED_WEAPON_AMMO))
                                        {
                                                // ran out of ammo!
-                                               self.cnt = WEP_CRYLINK;
+                                               self.cnt = WEP_CRYLINK.m_id;
                                                self.switchweapon = w_getbestweapon(self);
                                        }
                                }
@@ -654,7 +654,7 @@ bool W_Crylink(int req)
                                return true;
 
                        ammo_amount = self.WEP_AMMO(CRYLINK) >= WEP_CVAR_PRI(crylink, ammo);
-                       ammo_amount += self.(weapon_load[WEP_CRYLINK]) >= WEP_CVAR_PRI(crylink, ammo);
+                       ammo_amount += self.(weapon_load[WEP_CRYLINK.m_id]) >= WEP_CVAR_PRI(crylink, ammo);
                        return ammo_amount;
                }
                case WR_CHECKAMMO2:
@@ -664,7 +664,7 @@ bool W_Crylink(int req)
                                return true;
 
                        ammo_amount = self.WEP_AMMO(CRYLINK) >= WEP_CVAR_SEC(crylink, ammo);
-                       ammo_amount += self.(weapon_load[WEP_CRYLINK]) >= WEP_CVAR_SEC(crylink, ammo);
+                       ammo_amount += self.(weapon_load[WEP_CRYLINK.m_id]) >= WEP_CVAR_SEC(crylink, ammo);
                        return ammo_amount;
                }
                case WR_CONFIG:
index f6dcba033686b78ac8480b46cb40d248db31e57f..1518426ea6046e817094486d5293de3a6e72d4a6 100644 (file)
@@ -62,7 +62,7 @@ DEVASTATOR_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 #endif
 #ifdef IMPLEMENTATION
 #ifdef SVQC
-void spawnfunc_weapon_devastator(void) { weapon_defaultspawnfunc(WEP_DEVASTATOR); }
+void spawnfunc_weapon_devastator(void) { weapon_defaultspawnfunc(WEP_DEVASTATOR.m_id); }
 void spawnfunc_weapon_rocketlauncher(void) { spawnfunc_weapon_devastator(); }
 
 void W_Devastator_Unregister(void)
@@ -101,12 +101,12 @@ void W_Devastator_Explode(void)
                other
        );
 
-       if(self.realowner.weapon == WEP_DEVASTATOR)
+       if(self.realowner.weapon == WEP_DEVASTATOR.m_id)
        {
                if(self.realowner.WEP_AMMO(DEVASTATOR) < WEP_CVAR(devastator, ammo))
                if(!(self.realowner.items & IT_UNLIMITED_WEAPON_AMMO))
                {
-                       self.realowner.cnt = WEP_DEVASTATOR;
+                       self.realowner.cnt = WEP_DEVASTATOR.m_id;
                        ATTACK_FINISHED(self.realowner) = time;
                        self.realowner.switchweapon = w_getbestweapon(self.realowner);
                }
@@ -180,12 +180,12 @@ void W_Devastator_DoRemoteExplode(void)
                world
        );
 
-       if(self.realowner.weapon == WEP_DEVASTATOR)
+       if(self.realowner.weapon == WEP_DEVASTATOR.m_id)
        {
                if(self.realowner.WEP_AMMO(DEVASTATOR) < WEP_CVAR(devastator, ammo))
                if(!(self.realowner.items & IT_UNLIMITED_WEAPON_AMMO))
                {
-                       self.realowner.cnt = WEP_DEVASTATOR;
+                       self.realowner.cnt = WEP_DEVASTATOR.m_id;
                        ATTACK_FINISHED(self.realowner) = time;
                        self.realowner.switchweapon = w_getbestweapon(self.realowner);
                }
@@ -261,7 +261,7 @@ void W_Devastator_Think(void)
                self.velocity = self.velocity + v_forward * min(WEP_CVAR(devastator, speedaccel) * W_WeaponSpeedFactor() * frametime, velspeed);
 
        // laser guided, or remote detonation
-       if(self.realowner.weapon == WEP_DEVASTATOR)
+       if(self.realowner.weapon == WEP_DEVASTATOR.m_id)
        {
                if(self == self.realowner.lastrocket)
                if(!self.realowner.rl_release)
@@ -365,7 +365,7 @@ void W_Devastator_Attack(void)
 
        missile.movetype = MOVETYPE_FLY;
        PROJECTILE_MAKETRIGGER(missile);
-       missile.projectiledeathtype = WEP_DEVASTATOR;
+       missile.projectiledeathtype = WEP_DEVASTATOR.m_id;
        setsize(missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
 
        setorigin(missile, w_shotorg - v_forward * 3); // move it back so it hits the wall at the right point
@@ -547,7 +547,7 @@ bool W_Devastator(int req)
                                        self.rl_release = 1;
 
                                if(self.BUTTON_ATCK2)
-                               if(self.switchweapon == WEP_DEVASTATOR)
+                               if(self.switchweapon == WEP_DEVASTATOR.m_id)
                                {
                                        rockfound = 0;
                                        for(rock = world; (rock = find(rock, classname, "rocket")); ) if(rock.realowner == self)
@@ -589,12 +589,12 @@ bool W_Devastator(int req)
                {
                        #if 0
                        // don't switch while guiding a missile
-                       if(ATTACK_FINISHED(self) <= time || self.weapon != WEP_DEVASTATOR)
+                       if(ATTACK_FINISHED(self) <= time || self.weapon != WEP_DEVASTATOR.m_id)
                        {
                                ammo_amount = false;
                                if(WEP_CVAR(devastator, reload_ammo))
                                {
-                                       if(self.WEP_AMMO(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.m_id]) < WEP_CVAR(devastator, ammo))
                                                ammo_amount = true;
                                }
                                else if(self.WEP_AMMO(DEVASTATOR) < WEP_CVAR(devastator, ammo))
@@ -611,13 +611,13 @@ bool W_Devastator(int req)
                        else
                        {
                                ammo_amount = self.WEP_AMMO(DEVASTATOR) >= WEP_CVAR(devastator, ammo);
-                               ammo_amount += self.(weapon_load[WEP_DEVASTATOR]) >= WEP_CVAR(devastator, ammo);
+                               ammo_amount += self.(weapon_load[WEP_DEVASTATOR.m_id]) >= WEP_CVAR(devastator, ammo);
                                printf("W_Devastator(WR_CHECKAMMO1): %d, %.2f, %d: %s\n", self.rl_release, self.WEP_AMMO(DEVASTATOR), WEP_CVAR(devastator, ammo), (ammo_amount ? "TRUE" : "FALSE"));
                                return ammo_amount;
                        }
                        #else
                        ammo_amount = self.WEP_AMMO(DEVASTATOR) >= WEP_CVAR(devastator, ammo);
-                       ammo_amount += self.(weapon_load[WEP_DEVASTATOR]) >= WEP_CVAR(devastator, ammo);
+                       ammo_amount += self.(weapon_load[WEP_DEVASTATOR.m_id]) >= WEP_CVAR(devastator, ammo);
                        return ammo_amount;
                        #endif
                }
index 05e696987fa063915f4fc90c8850877caf0e41e9..fa8fd26e6a4206da55e040f4fbc75c26526baa3a 100644 (file)
@@ -67,7 +67,7 @@ void W_Electro_ExplodeCombo(void);
 #endif
 #ifdef IMPLEMENTATION
 #ifdef SVQC
-void spawnfunc_weapon_electro(void) { weapon_defaultspawnfunc(WEP_ELECTRO); }
+void spawnfunc_weapon_electro(void) { weapon_defaultspawnfunc(WEP_ELECTRO.m_id); }
 
 void W_Electro_TriggerCombo(vector org, float rad, entity own)
 {
@@ -131,7 +131,7 @@ void W_Electro_ExplodeCombo(void)
                world,
                world,
                WEP_CVAR(electro, combo_force),
-               WEP_ELECTRO | HITTYPE_BOUNCE, // use THIS type for a combo because primary can't bounce
+               WEP_ELECTRO.m_id | HITTYPE_BOUNCE, // use THIS type for a combo because primary can't bounce
                world
        );
 
@@ -272,7 +272,7 @@ void W_Electro_Attack_Bolt(void)
        proj.nextthink = time;
        proj.ltime = time + WEP_CVAR_PRI(electro, lifetime);
        PROJECTILE_MAKETRIGGER(proj);
-       proj.projectiledeathtype = WEP_ELECTRO;
+       proj.projectiledeathtype = WEP_ELECTRO.m_id;
        setorigin(proj, w_shotorg);
 
        proj.movetype = MOVETYPE_FLY;
@@ -371,7 +371,7 @@ void W_Electro_Attack_Orb(void)
        proj.bot_dodgerating = WEP_CVAR_SEC(electro, damage);
        proj.nextthink = time + WEP_CVAR_SEC(electro, lifetime);
        PROJECTILE_MAKETRIGGER(proj);
-       proj.projectiledeathtype = WEP_ELECTRO | HITTYPE_SECONDARY;
+       proj.projectiledeathtype = WEP_ELECTRO.m_id | HITTYPE_SECONDARY;
        setorigin(proj, w_shotorg);
 
        //proj.glow_size = 50;
@@ -512,7 +512,7 @@ bool W_Electro(int req)
                case WR_CHECKAMMO1:
                {
                        ammo_amount = self.WEP_AMMO(ELECTRO) >= WEP_CVAR_PRI(electro, ammo);
-                       ammo_amount += self.(weapon_load[WEP_ELECTRO]) >= WEP_CVAR_PRI(electro, ammo);
+                       ammo_amount += self.(weapon_load[WEP_ELECTRO.m_id]) >= WEP_CVAR_PRI(electro, ammo);
                        return ammo_amount;
                }
                case WR_CHECKAMMO2:
@@ -520,12 +520,12 @@ bool W_Electro(int 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(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);
+                               ammo_amount += self.(weapon_load[WEP_ELECTRO.m_id]) >= WEP_CVAR_SEC(electro, ammo) + WEP_CVAR_PRI(electro, ammo);
                        }
                        else
                        {
                                ammo_amount = self.WEP_AMMO(ELECTRO) >= WEP_CVAR_SEC(electro, ammo);
-                               ammo_amount += self.(weapon_load[WEP_ELECTRO]) >= WEP_CVAR_SEC(electro, ammo);
+                               ammo_amount += self.(weapon_load[WEP_ELECTRO.m_id]) >= WEP_CVAR_SEC(electro, ammo);
                        }
                        return ammo_amount;
                }
index 3129a0da54c84b056f6f9b8b534ea618c36a37f7..32ae555e41b47ca97f8419078e819943b441b97a 100644 (file)
@@ -55,7 +55,7 @@ FIREBALL_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 #endif
 #ifdef IMPLEMENTATION
 #ifdef SVQC
-void spawnfunc_weapon_fireball(void) { weapon_defaultspawnfunc(WEP_FIREBALL); }
+void spawnfunc_weapon_fireball(void) { weapon_defaultspawnfunc(WEP_FIREBALL.m_id); }
 
 void W_Fireball_Explode(void)
 {
@@ -97,7 +97,7 @@ void W_Fireball_Explode(void)
                        dir = normalize(e.origin + e.view_ofs - self.origin);
 
                        if(accuracy_isgooddamage(self.realowner, e))
-                               accuracy_add(self.realowner, WEP_FIREBALL, 0, WEP_CVAR_PRI(fireball, bfgdamage) * points);
+                               accuracy_add(self.realowner, WEP_FIREBALL.m_id, 0, WEP_CVAR_PRI(fireball, bfgdamage) * points);
 
                        Damage(e, self, self.realowner, WEP_CVAR_PRI(fireball, bfgdamage) * points, self.projectiledeathtype | HITTYPE_BOUNCE | HITTYPE_SPLASH, e.origin + e.view_ofs, WEP_CVAR_PRI(fireball, bfgforce) * dir);
                        pointparticles(particleeffectnum("fireball_bfgdamage"), e.origin, -1 * dir, 1);
@@ -201,7 +201,7 @@ void W_Fireball_Attack1(void)
        proj.takedamage = DAMAGE_YES;
        proj.damageforcescale = WEP_CVAR_PRI(fireball, damageforcescale);
        PROJECTILE_MAKETRIGGER(proj);
-       proj.projectiledeathtype = WEP_FIREBALL;
+       proj.projectiledeathtype = WEP_FIREBALL.m_id;
        setorigin(proj, w_shotorg);
 
        proj.movetype = MOVETYPE_FLY;
@@ -328,7 +328,7 @@ void W_Fireball_Attack2(void)
        proj.bot_dodge = true;
        proj.bot_dodgerating = WEP_CVAR_SEC(fireball, damage);
        proj.movetype = MOVETYPE_BOUNCE;
-       proj.projectiledeathtype = WEP_FIREBALL | HITTYPE_SECONDARY;
+       proj.projectiledeathtype = WEP_FIREBALL.m_id | HITTYPE_SECONDARY;
        proj.touch = W_Fireball_Firemine_Touch;
        PROJECTILE_MAKETRIGGER(proj);
        setsize(proj, '-4 -4 -4', '4 4 4');
index 44fab91e036c33873a691f9100058e4fc6081c7e..172fd832ba61038e8ee519727524a472f7342ec3 100644 (file)
@@ -56,7 +56,7 @@ HAGAR_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 #endif
 #ifdef IMPLEMENTATION
 #ifdef SVQC
-void spawnfunc_weapon_hagar(void) { weapon_defaultspawnfunc(WEP_HAGAR); }
+void spawnfunc_weapon_hagar(void) { weapon_defaultspawnfunc(WEP_HAGAR.m_id); }
 
 // NO bounce protection, as bounces are limited!
 
@@ -148,7 +148,7 @@ void W_Hagar_Attack(void)
        missile.think = adaptor_think2use_hittype_splash;
        missile.nextthink = time + WEP_CVAR_PRI(hagar, lifetime);
        PROJECTILE_MAKETRIGGER(missile);
-       missile.projectiledeathtype = WEP_HAGAR;
+       missile.projectiledeathtype = WEP_HAGAR.m_id;
        setorigin(missile, w_shotorg);
        setsize(missile, '0 0 0', '0 0 0');
 
@@ -192,7 +192,7 @@ void W_Hagar_Attack2(void)
        missile.think = adaptor_think2use_hittype_splash;
        missile.nextthink = time + WEP_CVAR_SEC(hagar, lifetime_min) + random() * WEP_CVAR_SEC(hagar, lifetime_rand);
        PROJECTILE_MAKETRIGGER(missile);
-       missile.projectiledeathtype = WEP_HAGAR | HITTYPE_SECONDARY;
+       missile.projectiledeathtype = WEP_HAGAR.m_id | HITTYPE_SECONDARY;
        setorigin(missile, w_shotorg);
        setsize(missile, '0 0 0', '0 0 0');
 
@@ -251,7 +251,7 @@ void W_Hagar_Attack2_Load_Release(void)
                missile.think = adaptor_think2use_hittype_splash;
                missile.nextthink = time + WEP_CVAR_SEC(hagar, lifetime_min) + random() * WEP_CVAR_SEC(hagar, lifetime_rand);
                PROJECTILE_MAKETRIGGER(missile);
-               missile.projectiledeathtype = WEP_HAGAR | HITTYPE_SECONDARY;
+               missile.projectiledeathtype = WEP_HAGAR.m_id | HITTYPE_SECONDARY;
                setorigin(missile, w_shotorg);
                setsize(missile, '0 0 0', '0 0 0');
                missile.movetype = MOVETYPE_FLY;
@@ -303,7 +303,7 @@ void W_Hagar_Attack2_Load(void)
        if(self.items & IT_UNLIMITED_WEAPON_AMMO)
                enough_ammo = true;
        else if(autocvar_g_balance_hagar_reload_ammo)
-               enough_ammo = self.(weapon_load[WEP_HAGAR]) >= WEP_CVAR_SEC(hagar, ammo);
+               enough_ammo = self.(weapon_load[WEP_HAGAR.m_id]) >= WEP_CVAR_SEC(hagar, ammo);
        else
                enough_ammo = self.WEP_AMMO(HAGAR) >= WEP_CVAR_SEC(hagar, ammo);
 
@@ -473,13 +473,13 @@ bool W_Hagar(int req)
                case WR_CHECKAMMO1:
                {
                        ammo_amount = self.WEP_AMMO(HAGAR) >= WEP_CVAR_PRI(hagar, ammo);
-                       ammo_amount += self.(weapon_load[WEP_HAGAR]) >= WEP_CVAR_PRI(hagar, ammo);
+                       ammo_amount += self.(weapon_load[WEP_HAGAR.m_id]) >= WEP_CVAR_PRI(hagar, ammo);
                        return ammo_amount;
                }
                case WR_CHECKAMMO2:
                {
                        ammo_amount = self.WEP_AMMO(HAGAR) >= WEP_CVAR_SEC(hagar, ammo);
-                       ammo_amount += self.(weapon_load[WEP_HAGAR]) >= WEP_CVAR_SEC(hagar, ammo);
+                       ammo_amount += self.(weapon_load[WEP_HAGAR.m_id]) >= WEP_CVAR_SEC(hagar, ammo);
                        return ammo_amount;
                }
                case WR_CONFIG:
index 8c5a035268ca6285263ef72a5e0e8b5b37c713b4..b6b48918def5ae2f8863e197e6c4ddb09d700c33 100644 (file)
@@ -48,7 +48,7 @@ HLAC_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 #endif
 #ifdef IMPLEMENTATION
 #ifdef SVQC
-void spawnfunc_weapon_hlac(void) { weapon_defaultspawnfunc(WEP_HLAC); }
+void spawnfunc_weapon_hlac(void) { weapon_defaultspawnfunc(WEP_HLAC.m_id); }
 
 void W_HLAC_Touch(void)
 {
@@ -107,7 +107,7 @@ void W_HLAC_Attack(void)
     missile.nextthink = time + WEP_CVAR_PRI(hlac, lifetime);
 
        missile.flags = FL_PROJECTILE;
-       missile.projectiledeathtype = WEP_HLAC;
+       missile.projectiledeathtype = WEP_HLAC.m_id;
 
        CSQCProjectile(missile, true, PROJECTILE_HLAC, true);
 
@@ -151,7 +151,7 @@ void W_HLAC_Attack2(void)
 
        missile.flags = FL_PROJECTILE;
        missile.missile_flags = MIF_SPLASH;
-       missile.projectiledeathtype = WEP_HLAC | HITTYPE_SECONDARY;
+       missile.projectiledeathtype = WEP_HLAC.m_id | HITTYPE_SECONDARY;
 
        CSQCProjectile(missile, true, PROJECTILE_HLAC, true);
 
@@ -251,13 +251,13 @@ bool W_HLAC(int req)
                case WR_CHECKAMMO1:
                {
                        ammo_amount = self.WEP_AMMO(HLAC) >= WEP_CVAR_PRI(hlac, ammo);
-                       ammo_amount += self.(weapon_load[WEP_HLAC]) >= WEP_CVAR_PRI(hlac, ammo);
+                       ammo_amount += self.(weapon_load[WEP_HLAC.m_id]) >= WEP_CVAR_PRI(hlac, ammo);
                        return ammo_amount;
                }
                case WR_CHECKAMMO2:
                {
                        ammo_amount = self.WEP_AMMO(HLAC) >= WEP_CVAR_SEC(hlac, ammo);
-                       ammo_amount += self.(weapon_load[WEP_HLAC]) >= WEP_CVAR_SEC(hlac, ammo);
+                       ammo_amount += self.(weapon_load[WEP_HLAC.m_id]) >= WEP_CVAR_SEC(hlac, ammo);
                        return ammo_amount;
                }
                case WR_CONFIG:
index e01034442f83a839e8b85fff64ba2764d5a47c0a..de6df97671e7bc636bcdbe718e3429861ce2f0fe 100644 (file)
@@ -41,7 +41,7 @@ HMG_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 #ifdef IMPLEMENTATION
 #ifdef SVQC
 
-void spawnfunc_weapon_hmg() { weapon_defaultspawnfunc(WEP_HMG); }
+void spawnfunc_weapon_hmg() { weapon_defaultspawnfunc(WEP_HMG.m_id); }
 
 void W_HeavyMachineGun_Attack_Auto()
 {
@@ -70,7 +70,7 @@ void W_HeavyMachineGun_Attack_Auto()
        }
 
        float hmg_spread = bound(WEP_CVAR(hmg, spread_min), WEP_CVAR(hmg, spread_min) + (WEP_CVAR(hmg, spread_add) * self.misc_bulletcounter), WEP_CVAR(hmg, spread_max));
-       fireBullet(w_shotorg, w_shotdir, hmg_spread, WEP_CVAR(hmg, solidpenetration), WEP_CVAR(hmg, damage), WEP_CVAR(hmg, force), WEP_HMG, 0);
+       fireBullet(w_shotorg, w_shotdir, hmg_spread, WEP_CVAR(hmg, solidpenetration), WEP_CVAR(hmg, damage), WEP_CVAR(hmg, force), WEP_HMG.m_id, 0);
 
        self.misc_bulletcounter = self.misc_bulletcounter + 1;
 
@@ -131,7 +131,7 @@ bool W_HeavyMachineGun(int req)
                        ammo_amount = self.ammo_nails >= WEP_CVAR(hmg, ammo);
 
                        if(autocvar_g_balance_hmg_reload_ammo)
-                               ammo_amount += self.(weapon_load[WEP_HMG]) >= WEP_CVAR(hmg, ammo);
+                               ammo_amount += self.(weapon_load[WEP_HMG.m_id]) >= WEP_CVAR(hmg, ammo);
 
                        return ammo_amount;
                }
@@ -140,7 +140,7 @@ bool W_HeavyMachineGun(int req)
                        ammo_amount = self.ammo_nails >= WEP_CVAR(hmg, ammo);
 
                        if(autocvar_g_balance_hmg_reload_ammo)
-                               ammo_amount += self.(weapon_load[WEP_HMG]) >= WEP_CVAR(hmg, ammo);
+                               ammo_amount += self.(weapon_load[WEP_HMG.m_id]) >= WEP_CVAR(hmg, ammo);
 
                        return ammo_amount;
                }
index d833f8d17928f2beaaffcb531d183e884f95af4a..7b08621d4bce6f46eb19a50d583ca121f9db7564 100644 (file)
@@ -67,7 +67,7 @@ void spawnfunc_weapon_hook(void)
                remove(self);
                return;
        }
-       weapon_defaultspawnfunc(WEP_HOOK);
+       weapon_defaultspawnfunc(WEP_HOOK.m_id);
 }
 
 void W_Hook_ExplodeThink(void)
@@ -143,7 +143,7 @@ void W_Hook_Attack2(void)
        gren.bot_dodgerating = WEP_CVAR_SEC(hook, damage);
        gren.movetype = MOVETYPE_TOSS;
        PROJECTILE_MAKETRIGGER(gren);
-       gren.projectiledeathtype = WEP_HOOK | HITTYPE_SECONDARY;
+       gren.projectiledeathtype = WEP_HOOK.m_id | HITTYPE_SECONDARY;
        setorigin(gren, w_shotorg);
        setsize(gren, '0 0 0', '0 0 0');
 
index 7e2cc5278ea8a96bfac6d5335ea635b704623b19..92629a0bd7116a5f40c5c0e5d059914d0089749c 100644 (file)
@@ -60,10 +60,10 @@ void spawnfunc_weapon_machinegun(void)
        if(autocvar_sv_q3acompat_machineshotgunswap)
        if(self.classname != "droppedweapon")
        {
-               weapon_defaultspawnfunc(WEP_SHOCKWAVE);
+               weapon_defaultspawnfunc(WEP_SHOCKWAVE.m_id);
                return;
        }
-       weapon_defaultspawnfunc(WEP_MACHINEGUN);
+       weapon_defaultspawnfunc(WEP_MACHINEGUN.m_id);
 }
 void spawnfunc_weapon_uzi(void) { spawnfunc_weapon_machinegun(); }
 
@@ -152,7 +152,7 @@ void W_MachineGun_Attack_Frame(void)
                        return;
                }
                self.misc_bulletcounter = self.misc_bulletcounter + 1;
-               W_MachineGun_Attack(WEP_MACHINEGUN);
+               W_MachineGun_Attack(WEP_MACHINEGUN.m_id);
                weapon_thinkf(WFRAME_FIRE1, WEP_CVAR(machinegun, sustained_refire), W_MachineGun_Attack_Frame);
        }
        else
@@ -188,7 +188,7 @@ void W_MachineGun_Attack_Auto(void)
        }
 
        machinegun_spread = bound(WEP_CVAR(machinegun, spread_min), WEP_CVAR(machinegun, spread_min) + (WEP_CVAR(machinegun, spread_add) * self.misc_bulletcounter), WEP_CVAR(machinegun, spread_max));
-       fireBullet(w_shotorg, w_shotdir, machinegun_spread, WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), WEP_MACHINEGUN, 0);
+       fireBullet(w_shotorg, w_shotdir, machinegun_spread, WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), WEP_MACHINEGUN.m_id, 0);
 
        self.misc_bulletcounter = self.misc_bulletcounter + 1;
 
@@ -213,7 +213,7 @@ void W_MachineGun_Attack_Burst(void)
                self.punchangle_y = random() - 0.5;
        }
 
-       fireBullet(w_shotorg, w_shotdir, WEP_CVAR(machinegun, burst_speed), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), WEP_MACHINEGUN, 0);
+       fireBullet(w_shotorg, w_shotdir, WEP_CVAR(machinegun, burst_speed), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), WEP_MACHINEGUN.m_id, 0);
 
        pointparticles(particleeffectnum("uzi_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 
@@ -287,7 +287,7 @@ bool W_MachineGun(int req)
                                if(weapon_prepareattack(0, 0))
                                {
                                        self.misc_bulletcounter = 1;
-                                       W_MachineGun_Attack(WEP_MACHINEGUN); // sets attack_finished
+                                       W_MachineGun_Attack(WEP_MACHINEGUN.m_id); // sets attack_finished
                                        weapon_thinkf(WFRAME_FIRE1, WEP_CVAR(machinegun, sustained_refire), W_MachineGun_Attack_Frame);
                                }
 
@@ -295,7 +295,7 @@ bool W_MachineGun(int req)
                                if(weapon_prepareattack(1, 0))
                                {
                                        self.misc_bulletcounter = 1;
-                                       W_MachineGun_Attack(WEP_MACHINEGUN | HITTYPE_SECONDARY); // sets attack_finished
+                                       W_MachineGun_Attack(WEP_MACHINEGUN.m_id | HITTYPE_SECONDARY); // sets attack_finished
                                        weapon_thinkf(WFRAME_FIRE2, WEP_CVAR(machinegun, first_refire), w_ready);
                                }
                        }
@@ -322,9 +322,9 @@ bool W_MachineGun(int req)
                        if(WEP_CVAR(machinegun, reload_ammo))
                        {
                                if(WEP_CVAR(machinegun, mode) == 1)
-                                       ammo_amount += self.(weapon_load[WEP_MACHINEGUN]) >= WEP_CVAR(machinegun, sustained_ammo);
+                                       ammo_amount += self.(weapon_load[WEP_MACHINEGUN.m_id]) >= WEP_CVAR(machinegun, sustained_ammo);
                                else
-                                       ammo_amount += self.(weapon_load[WEP_MACHINEGUN]) >= WEP_CVAR(machinegun, first_ammo);
+                                       ammo_amount += self.(weapon_load[WEP_MACHINEGUN.m_id]) >= WEP_CVAR(machinegun, first_ammo);
                        }
                        return ammo_amount;
                }
@@ -338,9 +338,9 @@ bool W_MachineGun(int req)
                        if(WEP_CVAR(machinegun, reload_ammo))
                        {
                                if(WEP_CVAR(machinegun, mode) == 1)
-                                       ammo_amount += self.(weapon_load[WEP_MACHINEGUN]) >= WEP_CVAR(machinegun, burst_ammo);
+                                       ammo_amount += self.(weapon_load[WEP_MACHINEGUN.m_id]) >= WEP_CVAR(machinegun, burst_ammo);
                                else
-                                       ammo_amount += self.(weapon_load[WEP_MACHINEGUN]) >= WEP_CVAR(machinegun, first_ammo);
+                                       ammo_amount += self.(weapon_load[WEP_MACHINEGUN.m_id]) >= WEP_CVAR(machinegun, first_ammo);
                        }
                        return ammo_amount;
                }
index dd449e83952531e5c2088936f58be7b38cccfa01..666e13b4ced9e309dfd503a7ddd9dc16d0960888 100644 (file)
@@ -57,7 +57,7 @@ void W_MineLayer_Think(void);
 #endif
 #ifdef IMPLEMENTATION
 #ifdef SVQC
-void spawnfunc_weapon_minelayer(void) { weapon_defaultspawnfunc(WEP_MINE_LAYER); }
+void spawnfunc_weapon_minelayer(void) { weapon_defaultspawnfunc(WEP_MINE_LAYER.m_id); }
 
 void W_MineLayer_Stick(entity to)
 {
@@ -120,14 +120,14 @@ void W_MineLayer_Explode(void)
 
        RadiusDamage(self, self.realowner, WEP_CVAR(minelayer, damage), WEP_CVAR(minelayer, edgedamage), WEP_CVAR(minelayer, radius), world, world, WEP_CVAR(minelayer, force), self.projectiledeathtype, other);
 
-       if(self.realowner.weapon == WEP_MINE_LAYER)
+       if(self.realowner.weapon == WEP_MINE_LAYER.m_id)
        {
                entity oldself;
                oldself = self;
                self = self.realowner;
-               if(!WEP_ACTION(WEP_MINE_LAYER, WR_CHECKAMMO1))
+               if(!WEP_ACTION(WEP_MINE_LAYER.m_id, WR_CHECKAMMO1))
                {
-                       self.cnt = WEP_MINE_LAYER;
+                       self.cnt = WEP_MINE_LAYER.m_id;
                        ATTACK_FINISHED(self) = time;
                        self.switchweapon = w_getbestweapon(self);
                }
@@ -147,14 +147,14 @@ void W_MineLayer_DoRemoteExplode(void)
 
        RadiusDamage(self, self.realowner, WEP_CVAR(minelayer, remote_damage), WEP_CVAR(minelayer, remote_edgedamage), WEP_CVAR(minelayer, remote_radius), world, world, WEP_CVAR(minelayer, remote_force), self.projectiledeathtype | HITTYPE_BOUNCE, world);
 
-       if(self.realowner.weapon == WEP_MINE_LAYER)
+       if(self.realowner.weapon == WEP_MINE_LAYER.m_id)
        {
                entity oldself;
                oldself = self;
                self = self.realowner;
-               if(!WEP_ACTION(WEP_MINE_LAYER, WR_CHECKAMMO1))
+               if(!WEP_ACTION(WEP_MINE_LAYER.m_id, WR_CHECKAMMO1))
                {
-                       self.cnt = WEP_MINE_LAYER;
+                       self.cnt = WEP_MINE_LAYER.m_id;
                        ATTACK_FINISHED(self) = time;
                        self.switchweapon = w_getbestweapon(self);
                }
@@ -262,7 +262,7 @@ void W_MineLayer_Think(void)
        }
 
        // remote detonation
-       if(self.realowner.weapon == WEP_MINE_LAYER)
+       if(self.realowner.weapon == WEP_MINE_LAYER.m_id)
        if(self.realowner.deadflag == DEAD_NO)
        if(self.minelayer_detonate)
                W_MineLayer_RemoteExplode();
@@ -348,7 +348,7 @@ void W_MineLayer_Attack(void)
 
        mine.movetype = MOVETYPE_TOSS;
        PROJECTILE_MAKETRIGGER(mine);
-       mine.projectiledeathtype = WEP_MINE_LAYER;
+       mine.projectiledeathtype = WEP_MINE_LAYER.m_id;
        setsize(mine, '-4 -4 -4', '4 4 4'); // give it some size so it can be shot
 
        setorigin(mine, w_shotorg - v_forward * 4); // move it back so it hits the wall at the right point
@@ -549,10 +549,10 @@ bool W_MineLayer(int req)
                case WR_CHECKAMMO1:
                {
                        // don't switch while placing a mine
-                       if(ATTACK_FINISHED(self) <= time || self.weapon != WEP_MINE_LAYER)
+                       if(ATTACK_FINISHED(self) <= time || self.weapon != WEP_MINE_LAYER.m_id)
                        {
                                ammo_amount = self.WEP_AMMO(MINE_LAYER) >= WEP_CVAR(minelayer, ammo);
-                               ammo_amount += self.(weapon_load[WEP_MINE_LAYER]) >= WEP_CVAR(minelayer, ammo);
+                               ammo_amount += self.(weapon_load[WEP_MINE_LAYER.m_id]) >= WEP_CVAR(minelayer, ammo);
                                return ammo_amount;
                        }
                        return true;
index 615c30c5922f0ee71864307e74eb70adb92e52dc..cf37372db69f46661396296b4020d1d9c658f605 100644 (file)
@@ -56,7 +56,7 @@ MORTAR_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 #ifdef IMPLEMENTATION
 #ifdef SVQC
 
-void spawnfunc_weapon_mortar(void) { weapon_defaultspawnfunc(WEP_MORTAR); }
+void spawnfunc_weapon_mortar(void) { weapon_defaultspawnfunc(WEP_MORTAR.m_id); }
 void spawnfunc_weapon_grenadelauncher(void) { spawnfunc_weapon_mortar(); }
 
 void W_Mortar_Grenade_Explode(void)
@@ -242,7 +242,7 @@ void W_Mortar_Attack(void)
        gren.bouncefactor = WEP_CVAR(mortar, bouncefactor);
        gren.bouncestop = WEP_CVAR(mortar, bouncestop);
        PROJECTILE_MAKETRIGGER(gren);
-       gren.projectiledeathtype = WEP_MORTAR;
+       gren.projectiledeathtype = WEP_MORTAR.m_id;
        setorigin(gren, w_shotorg);
        setsize(gren, '-3 -3 -3', '3 3 3');
 
@@ -291,7 +291,7 @@ void W_Mortar_Attack2(void)
        gren.bouncefactor = WEP_CVAR(mortar, bouncefactor);
        gren.bouncestop = WEP_CVAR(mortar, bouncestop);
        PROJECTILE_MAKETRIGGER(gren);
-       gren.projectiledeathtype = WEP_MORTAR | HITTYPE_SECONDARY;
+       gren.projectiledeathtype = WEP_MORTAR.m_id | HITTYPE_SECONDARY;
        setorigin(gren, w_shotorg);
        setsize(gren, '-3 -3 -3', '3 3 3');
 
@@ -422,13 +422,13 @@ bool W_Mortar(int req)
                case WR_CHECKAMMO1:
                {
                        ammo_amount = self.WEP_AMMO(MORTAR) >= WEP_CVAR_PRI(mortar, ammo);
-                       ammo_amount += self.(weapon_load[WEP_MORTAR]) >= WEP_CVAR_PRI(mortar, ammo);
+                       ammo_amount += self.(weapon_load[WEP_MORTAR.m_id]) >= WEP_CVAR_PRI(mortar, ammo);
                        return ammo_amount;
                }
                case WR_CHECKAMMO2:
                {
                        ammo_amount = self.WEP_AMMO(MORTAR) >= WEP_CVAR_SEC(mortar, ammo);
-                       ammo_amount += self.(weapon_load[WEP_MORTAR]) >= WEP_CVAR_SEC(mortar, ammo);
+                       ammo_amount += self.(weapon_load[WEP_MORTAR.m_id]) >= WEP_CVAR_SEC(mortar, ammo);
                        return ammo_amount;
                }
                case WR_CONFIG:
index f3976fc6a0f69ca820f1012951db2f35c0cc4c98..40f38256f75fe1b6b1fe48a39df1e89b2c9c7991 100644 (file)
@@ -41,7 +41,7 @@ PORTO_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 #ifdef SVQC
 #include "../triggers/trigger/jumppads.qh"
 
-void spawnfunc_weapon_porto(void) { weapon_defaultspawnfunc(WEP_PORTO); }
+void spawnfunc_weapon_porto(void) { weapon_defaultspawnfunc(WEP_PORTO.m_id); }
 
 void W_Porto_Success(void)
 {
@@ -83,7 +83,7 @@ void W_Porto_Fail(float failhard)
                        tracetoss(self, self);
                        if(vlen(trace_endpos - self.realowner.origin) < 128)
                        {
-                               W_ThrowNewWeapon(self.realowner, WEP_PORTO, 0, self.origin, self.velocity);
+                               W_ThrowNewWeapon(self.realowner, WEP_PORTO.m_id, 0, self.origin, self.velocity);
                                Send_Notification(NOTIF_ONE, self.realowner, MSG_CENTER, CENTER_PORTO_FAILED);
                        }
                }
index eb80215bcec9502b84b1c48a69770e04beafd722..fc8f60ec4f7d855dc92eb43329b9a5cb4121e0bb 100644 (file)
@@ -47,7 +47,7 @@ RIFLE_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 #endif
 #ifdef IMPLEMENTATION
 #ifdef SVQC
-void spawnfunc_weapon_rifle(void) { weapon_defaultspawnfunc(WEP_RIFLE); }
+void spawnfunc_weapon_rifle(void) { weapon_defaultspawnfunc(WEP_RIFLE.m_id); }
 void spawnfunc_weapon_campingrifle(void) { spawnfunc_weapon_rifle(); }
 void spawnfunc_weapon_sniperrifle(void) { spawnfunc_weapon_rifle(); }
 
@@ -76,12 +76,12 @@ void W_Rifle_FireBullet(float pSpread, float pDamage, float pForce, float pSolid
 
 void W_Rifle_Attack(void)
 {
-       W_Rifle_FireBullet(WEP_CVAR_PRI(rifle, spread), WEP_CVAR_PRI(rifle, damage), WEP_CVAR_PRI(rifle, force), WEP_CVAR_PRI(rifle, solidpenetration), WEP_CVAR_PRI(rifle, ammo), WEP_RIFLE, WEP_CVAR_PRI(rifle, tracer), WEP_CVAR_PRI(rifle, shots), "weapons/campingrifle_fire.wav");
+       W_Rifle_FireBullet(WEP_CVAR_PRI(rifle, spread), WEP_CVAR_PRI(rifle, damage), WEP_CVAR_PRI(rifle, force), WEP_CVAR_PRI(rifle, solidpenetration), WEP_CVAR_PRI(rifle, ammo), WEP_RIFLE.m_id, WEP_CVAR_PRI(rifle, tracer), WEP_CVAR_PRI(rifle, shots), "weapons/campingrifle_fire.wav");
 }
 
 void W_Rifle_Attack2(void)
 {
-       W_Rifle_FireBullet(WEP_CVAR_SEC(rifle, spread), WEP_CVAR_SEC(rifle, damage), WEP_CVAR_SEC(rifle, force), WEP_CVAR_SEC(rifle, solidpenetration), WEP_CVAR_SEC(rifle, ammo), WEP_RIFLE | HITTYPE_SECONDARY, WEP_CVAR_SEC(rifle, tracer), WEP_CVAR_SEC(rifle, shots), "weapons/campingrifle_fire2.wav");
+       W_Rifle_FireBullet(WEP_CVAR_SEC(rifle, spread), WEP_CVAR_SEC(rifle, damage), WEP_CVAR_SEC(rifle, force), WEP_CVAR_SEC(rifle, solidpenetration), WEP_CVAR_SEC(rifle, ammo), WEP_RIFLE.m_id | HITTYPE_SECONDARY, WEP_CVAR_SEC(rifle, tracer), WEP_CVAR_SEC(rifle, shots), "weapons/campingrifle_fire2.wav");
 }
 
 .void(void) rifle_bullethail_attackfunc;
@@ -215,13 +215,13 @@ bool W_Rifle(int req)
                case WR_CHECKAMMO1:
                {
                        ammo_amount = self.WEP_AMMO(RIFLE) >= WEP_CVAR_PRI(rifle, ammo);
-                       ammo_amount += self.(weapon_load[WEP_RIFLE]) >= WEP_CVAR_PRI(rifle, ammo);
+                       ammo_amount += self.(weapon_load[WEP_RIFLE.m_id]) >= WEP_CVAR_PRI(rifle, ammo);
                        return ammo_amount;
                }
                case WR_CHECKAMMO2:
                {
                        ammo_amount = self.WEP_AMMO(RIFLE) >= WEP_CVAR_SEC(rifle, ammo);
-                       ammo_amount += self.(weapon_load[WEP_RIFLE]) >= WEP_CVAR_SEC(rifle, ammo);
+                       ammo_amount += self.(weapon_load[WEP_RIFLE.m_id]) >= WEP_CVAR_SEC(rifle, ammo);
                        return ammo_amount;
                }
                case WR_CONFIG:
index f26649b8b6720fc6c81dc935012e30fb96ea75ac..6e0d4400746e3af688e2a6712cb9e4a2bda870e4 100644 (file)
@@ -45,7 +45,7 @@ RPC_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 #endif
 #ifdef IMPLEMENTATION
 #ifdef SVQC
-void spawnfunc_weapon_rpc() { weapon_defaultspawnfunc(WEP_RPC); }
+void spawnfunc_weapon_rpc() { weapon_defaultspawnfunc(WEP_RPC.m_id); }
 
 void W_RocketPropelledChainsaw_Explode()
 {
@@ -123,7 +123,7 @@ void W_RocketPropelledChainsaw_Attack (void)
        missile.damagedbycontents = true;
        missile.movetype = MOVETYPE_FLY;
 
-       missile.projectiledeathtype = WEP_RPC;
+       missile.projectiledeathtype = WEP_RPC.m_id;
        setsize (missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
 
        setorigin (missile, w_shotorg - v_forward * 3); // move it back so it hits the wall at the right point
@@ -193,7 +193,7 @@ bool W_RocketPropelledChainsaw(int req)
                case WR_CHECKAMMO1:
                {
                        ammo_amount = self.WEP_AMMO(RPC) >= WEP_CVAR(rpc, ammo);
-                       ammo_amount += self.(weapon_load[WEP_RPC]) >= WEP_CVAR(rpc, ammo);
+                       ammo_amount += self.(weapon_load[WEP_RPC.m_id]) >= WEP_CVAR(rpc, ammo);
                        return ammo_amount;
                }
                case WR_CHECKAMMO2:
index f3d1ea8362ff208de7c7605f3be2d6ec5bb2df3c..a4a43098298f3494742a754d03d091b3c7e615cc 100644 (file)
@@ -84,7 +84,7 @@ SEEKER_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 #endif
 #ifdef IMPLEMENTATION
 #ifdef SVQC
-void spawnfunc_weapon_seeker(void) { weapon_defaultspawnfunc(WEP_SEEKER); }
+void spawnfunc_weapon_seeker(void) { weapon_defaultspawnfunc(WEP_SEEKER.m_id); }
 
 // ============================
 // Begin: Missile functions, these are general functions to be manipulated by other code
@@ -277,9 +277,9 @@ void W_Seeker_Fire_Missile(vector f_diff, entity m_target)
        //missile.think           = W_Seeker_Missile_Animate; // csqc projectiles.
 
        if(missile.enemy != world)
-               missile.projectiledeathtype = WEP_SEEKER | HITTYPE_SECONDARY;
+               missile.projectiledeathtype = WEP_SEEKER.m_id | HITTYPE_SECONDARY;
        else
-               missile.projectiledeathtype = WEP_SEEKER;
+               missile.projectiledeathtype = WEP_SEEKER.m_id;
 
 
        setorigin(missile, w_shotorg);
@@ -357,8 +357,8 @@ void W_Seeker_Fire_Flac(void)
        missile.nextthink               = time + WEP_CVAR(seeker, flac_lifetime) + WEP_CVAR(seeker, flac_lifetime_rand);
        missile.solid                   = SOLID_BBOX;
        missile.movetype                = MOVETYPE_FLY;
-       missile.projectiledeathtype = WEP_SEEKER;
-       missile.projectiledeathtype = WEP_SEEKER | HITTYPE_SECONDARY;
+       missile.projectiledeathtype = WEP_SEEKER.m_id;
+       missile.projectiledeathtype = WEP_SEEKER.m_id | HITTYPE_SECONDARY;
        missile.flags                           = FL_PROJECTILE;
        missile.missile_flags       = MIF_SPLASH;
 
@@ -417,7 +417,7 @@ void W_Seeker_Vollycontroller_Think(void) // TODO: Merge this with W_Seeker_Atta
        entity oldself,oldenemy;
        self.cnt = self.cnt - 1;
 
-       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))
+       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.m_id))
        {
                remove(self);
                return;
@@ -456,7 +456,7 @@ void W_Seeker_Vollycontroller_Think(void) // TODO: Merge this with W_Seeker_Atta
 void W_Seeker_Tracker_Think(void)
 {
        // commit suicide if: You die OR target dies OR you switch away from the seeker OR commit suicide if lifetime is up
-       if((self.realowner.deadflag != DEAD_NO) || (self.tag_target.deadflag != DEAD_NO) || (self.realowner.switchweapon != WEP_SEEKER)
+       if((self.realowner.deadflag != DEAD_NO) || (self.tag_target.deadflag != DEAD_NO) || (self.realowner.switchweapon != WEP_SEEKER.m_id)
        || (time > self.tag_time + WEP_CVAR(seeker, tag_tracker_lifetime)))
        {
                if(self)
@@ -478,7 +478,7 @@ void W_Seeker_Tag_Explode(void)
 {
        //if(other==self.realowner)
        //    return;
-       Damage_DamageInfo(self.origin, 0, 0, 0, self.velocity, WEP_SEEKER | HITTYPE_BOUNCE, other.species, self);
+       Damage_DamageInfo(self.origin, 0, 0, 0, self.velocity, WEP_SEEKER.m_id | HITTYPE_BOUNCE, other.species, self);
 
        remove(self);
 }
@@ -506,7 +506,7 @@ void W_Seeker_Tag_Touch(void)
        te_knightspike(org2);
 
        self.event_damage = func_null;
-       Damage_DamageInfo(self.origin, 0, 0, 0, self.velocity, WEP_SEEKER | HITTYPE_BOUNCE | HITTYPE_SECONDARY, other.species, self);
+       Damage_DamageInfo(self.origin, 0, 0, 0, self.velocity, WEP_SEEKER.m_id | HITTYPE_BOUNCE | HITTYPE_SECONDARY, other.species, self);
 
        if(other.takedamage == DAMAGE_AIM && other.deadflag == DEAD_NO)
        {
@@ -677,12 +677,12 @@ bool W_Seeker(int req)
                        if(WEP_CVAR(seeker, type) == 1)
                        {
                                ammo_amount = self.WEP_AMMO(SEEKER) >= WEP_CVAR(seeker, missile_ammo);
-                               ammo_amount += self.(weapon_load[WEP_SEEKER]) >= WEP_CVAR(seeker, missile_ammo);
+                               ammo_amount += self.(weapon_load[WEP_SEEKER.m_id]) >= WEP_CVAR(seeker, missile_ammo);
                        }
                        else
                        {
                                ammo_amount = self.WEP_AMMO(SEEKER) >= WEP_CVAR(seeker, tag_ammo);
-                               ammo_amount += self.(weapon_load[WEP_SEEKER]) >= WEP_CVAR(seeker, tag_ammo);
+                               ammo_amount += self.(weapon_load[WEP_SEEKER.m_id]) >= WEP_CVAR(seeker, tag_ammo);
                        }
                        return ammo_amount;
                }
@@ -691,12 +691,12 @@ bool W_Seeker(int req)
                        if(WEP_CVAR(seeker, type) == 1)
                        {
                                ammo_amount = self.WEP_AMMO(SEEKER) >= WEP_CVAR(seeker, tag_ammo);
-                               ammo_amount += self.(weapon_load[WEP_SEEKER]) >= WEP_CVAR(seeker, tag_ammo);
+                               ammo_amount += self.(weapon_load[WEP_SEEKER.m_id]) >= WEP_CVAR(seeker, tag_ammo);
                        }
                        else
                        {
                                ammo_amount = self.WEP_AMMO(SEEKER) >= WEP_CVAR(seeker, flac_ammo);
-                               ammo_amount += self.(weapon_load[WEP_SEEKER]) >= WEP_CVAR(seeker, flac_ammo);
+                               ammo_amount += self.(weapon_load[WEP_SEEKER.m_id]) >= WEP_CVAR(seeker, flac_ammo);
                        }
                        return ammo_amount;
                }
index 1c0be55032d52e2b8eded2f9a8ca9b08514f9a55..592f200b9e5f4934897f60866521a9bee01390ff 100644 (file)
@@ -88,10 +88,10 @@ void spawnfunc_weapon_shockwave(void)
        if(autocvar_sv_q3acompat_machineshotgunswap)
        if(self.classname != "droppedweapon")
        {
-               weapon_defaultspawnfunc(WEP_MACHINEGUN);
+               weapon_defaultspawnfunc(WEP_MACHINEGUN.m_id);
                return;
        }
-       weapon_defaultspawnfunc(WEP_SHOCKWAVE);
+       weapon_defaultspawnfunc(WEP_SHOCKWAVE.m_id);
 }
 
 const float MAX_SHOCKWAVE_HITS = 10;
@@ -179,14 +179,14 @@ void W_Shockwave_Melee_Think(void)
                                self.realowner,
                                self.realowner,
                                swing_damage,
-                               (WEP_SHOCKWAVE | HITTYPE_SECONDARY),
+                               (WEP_SHOCKWAVE.m_id | HITTYPE_SECONDARY),
                                (self.realowner.origin + self.realowner.view_ofs),
                                (v_forward * WEP_CVAR(shockwave, melee_force))
                        );
 
                        // handle accuracy
                        if(accuracy_isgooddamage(self.realowner, target_victim))
-                               { accuracy_add(self.realowner, WEP_SHOCKWAVE, 0, swing_damage); }
+                               { accuracy_add(self.realowner, WEP_SHOCKWAVE.m_id, 0, swing_damage); }
 
                        #ifdef DEBUG_SHOCKWAVE
                        print(sprintf(
@@ -376,7 +376,7 @@ void W_Shockwave_Attack(void)
                WEP_CVAR(shockwave, blast_splash_edgedamage),
                WEP_CVAR(shockwave, blast_splash_radius),
                w_shotdir * WEP_CVAR(shockwave, blast_splash_force),
-               WEP_SHOCKWAVE,
+               WEP_SHOCKWAVE.m_id,
                0,
                self
        );
@@ -456,7 +456,7 @@ void W_Shockwave_Attack(void)
                                        self,
                                        self,
                                        final_damage,
-                                       WEP_SHOCKWAVE,
+                                       WEP_SHOCKWAVE.m_id,
                                        head.origin,
                                        final_force
                                );
@@ -640,7 +640,7 @@ void W_Shockwave_Attack(void)
                        self,
                        self,
                        final_damage,
-                       WEP_SHOCKWAVE,
+                       WEP_SHOCKWAVE.m_id,
                        head.origin,
                        final_force
                );
@@ -648,7 +648,7 @@ void W_Shockwave_Attack(void)
                if(accuracy_isgooddamage(self.realowner, head))
                {
                        print("wtf\n");
-                       accuracy_add(self.realowner, WEP_SHOCKWAVE, 0, final_damage);
+                       accuracy_add(self.realowner, WEP_SHOCKWAVE.m_id, 0, final_damage);
                }
 
                #ifdef DEBUG_SHOCKWAVE
index fb03b986f1e44ecf7d9aad50ec9d908ef5a846e2..1d91689e505e3310bbd4bf8a9c6919c668349377 100644 (file)
@@ -52,7 +52,7 @@ SHOTGUN_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 #endif
 #ifdef IMPLEMENTATION
 #ifdef SVQC
-void spawnfunc_weapon_shotgun(void) { weapon_defaultspawnfunc(WEP_SHOTGUN); }
+void spawnfunc_weapon_shotgun(void) { weapon_defaultspawnfunc(WEP_SHOTGUN.m_id); }
 
 void W_Shotgun_Attack(float isprimary)
 {
@@ -63,7 +63,7 @@ void W_Shotgun_Attack(float isprimary)
 
        W_SetupShot(self, true, 5, "weapons/shotgun_fire.wav", ((isprimary) ? CH_WEAPON_A : CH_WEAPON_SINGLE), WEP_CVAR_PRI(shotgun, damage) * WEP_CVAR_PRI(shotgun, bullets));
        for(sc = 0;sc < WEP_CVAR_PRI(shotgun, bullets);sc = sc + 1)
-               fireBullet(w_shotorg, w_shotdir, WEP_CVAR_PRI(shotgun, spread), WEP_CVAR_PRI(shotgun, solidpenetration), WEP_CVAR_PRI(shotgun, damage), WEP_CVAR_PRI(shotgun, force), WEP_SHOTGUN, 0);
+               fireBullet(w_shotorg, w_shotdir, WEP_CVAR_PRI(shotgun, spread), WEP_CVAR_PRI(shotgun, solidpenetration), WEP_CVAR_PRI(shotgun, damage), WEP_CVAR_PRI(shotgun, force), WEP_SHOTGUN.m_id, 0);
 
        pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 1000, WEP_CVAR_PRI(shotgun, ammo));
 
@@ -143,11 +143,11 @@ void W_Shotgun_Melee_Think(void)
                        //print(strcat(self.realowner.netname, " hitting ", target_victim.netname, " with ", strcat(ftos(swing_damage), " damage (factor: ", ftos(swing_factor), ") at "), ftos(time), " seconds.\n"));
 
                        Damage(target_victim, self.realowner, self.realowner,
-                               swing_damage, WEP_SHOTGUN | HITTYPE_SECONDARY,
+                               swing_damage, WEP_SHOTGUN.m_id | HITTYPE_SECONDARY,
                                self.realowner.origin + self.realowner.view_ofs,
                                v_forward * WEP_CVAR_SEC(shotgun, force));
 
-                       if(accuracy_isgooddamage(self.realowner, target_victim)) { accuracy_add(self.realowner, WEP_SHOTGUN, 0, swing_damage); }
+                       if(accuracy_isgooddamage(self.realowner, target_victim)) { accuracy_add(self.realowner, WEP_SHOTGUN.m_id, 0, swing_damage); }
 
                        // draw large red flash for debugging
                        //te_customflash(targpos, 200, 2, '15 0 0');
@@ -304,7 +304,7 @@ float W_Shotgun(float req)
                case WR_CHECKAMMO1:
                {
                        ammo_amount = self.WEP_AMMO(SHOTGUN) >= WEP_CVAR_PRI(shotgun, ammo);
-                       ammo_amount += self.(weapon_load[WEP_SHOTGUN]) >= WEP_CVAR_PRI(shotgun, ammo);
+                       ammo_amount += self.(weapon_load[WEP_SHOTGUN.m_id]) >= WEP_CVAR_PRI(shotgun, ammo);
                        return ammo_amount;
                }
                case WR_CHECKAMMO2:
@@ -318,7 +318,7 @@ float W_Shotgun(float req)
                                case 2: // secondary triple shot
                                {
                                        ammo_amount = self.WEP_AMMO(SHOTGUN) >= WEP_CVAR_PRI(shotgun, ammo);
-                                       ammo_amount += self.(weapon_load[WEP_SHOTGUN]) >= WEP_CVAR_PRI(shotgun, ammo);
+                                       ammo_amount += self.(weapon_load[WEP_SHOTGUN.m_id]) >= WEP_CVAR_PRI(shotgun, ammo);
                                        return ammo_amount;
                                }
                                default: return false; // secondary unavailable
index d8d3cf0e08eb5d8f1214e04ca38b555adeacaa92..48b92137ce619077f5b28d0fe19dca9c99543e74 100644 (file)
@@ -54,7 +54,7 @@ float W_Tuba_MarkClientOnlyFieldsAsUsed() {
 #endif
 #ifdef IMPLEMENTATION
 #ifdef SVQC
-void spawnfunc_weapon_tuba(void) { weapon_defaultspawnfunc(WEP_TUBA); }
+void spawnfunc_weapon_tuba(void) { weapon_defaultspawnfunc(WEP_TUBA.m_id); }
 
 bool W_Tuba_HasPlayed(entity pl, string melody, int instrument, bool ignorepitch, float mintempo, float maxtempo)
 {
@@ -358,7 +358,7 @@ void W_Tuba_NoteOn(float hittype)
        self.tuba_note.teleport_time = time + WEP_CVAR(tuba, refire) * 2 * W_WeaponRateFactor(); // so it can get prolonged safely
 
        //sound(self, c, TUBA_NOTE(n), bound(0, VOL_BASE * cvar("g_balance_tuba_volume"), 1), autocvar_g_balance_tuba_attenuation);
-       RadiusDamage(self, self, WEP_CVAR(tuba, damage), WEP_CVAR(tuba, edgedamage), WEP_CVAR(tuba, radius), world, world, WEP_CVAR(tuba, force), hittype | WEP_TUBA, world);
+       RadiusDamage(self, self, WEP_CVAR(tuba, damage), WEP_CVAR(tuba, edgedamage), WEP_CVAR(tuba, radius), world, world, WEP_CVAR(tuba, force), hittype | WEP_TUBA.m_id, world);
 
        o = gettaginfo(self.exteriorweaponentity, 0);
        if(time > self.tuba_smoketime)
index 83ebcf0ece6fde79364768e028593c6d806d2785..e96725b1ec8b8e002abc46a2bde0d9c29d21e6bb 100644 (file)
@@ -49,7 +49,7 @@ VAPORIZER_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 #endif
 #ifdef IMPLEMENTATION
 #ifdef SVQC
-void spawnfunc_weapon_vaporizer(void) { weapon_defaultspawnfunc(WEP_VAPORIZER); }
+void spawnfunc_weapon_vaporizer(void) { weapon_defaultspawnfunc(WEP_VAPORIZER.m_id); }
 void spawnfunc_weapon_minstanex(void) { spawnfunc_weapon_vaporizer(); }
 
 void W_Vaporizer_Attack(void)
@@ -64,7 +64,7 @@ void W_Vaporizer_Attack(void)
 
        yoda = 0;
        damage_goodhits = 0;
-       FireRailgunBullet(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 10000, 800, 0, 0, 0, 0, WEP_VAPORIZER);
+       FireRailgunBullet(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 10000, 800, 0, 0, 0, 0, WEP_VAPORIZER.m_id);
 
        if(yoda && flying)
                Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
@@ -166,9 +166,9 @@ float W_Vaporizer(float req)
 
                                        // ugly instagib hack to reuse the fire mode of the laser
                                        int oldwep = self.weapon; // we can't avoid this hack
-                                       self.weapon = WEP_BLASTER;
+                                       self.weapon = WEP_BLASTER.m_id;
                                        W_Blaster_Attack(
-                                               WEP_BLASTER | HITTYPE_SECONDARY,
+                                               WEP_BLASTER.m_id | HITTYPE_SECONDARY,
                                                WEP_CVAR_SEC(vaporizer, shotangle),
                                                WEP_CVAR_SEC(vaporizer, damage),
                                                WEP_CVAR_SEC(vaporizer, edgedamage),
@@ -211,7 +211,7 @@ float W_Vaporizer(float req)
                case WR_CHECKAMMO1:
                {
                        ammo_amount = self.WEP_AMMO(VAPORIZER) >= vaporizer_ammo;
-                       ammo_amount += self.(weapon_load[WEP_VAPORIZER]) >= vaporizer_ammo;
+                       ammo_amount += self.(weapon_load[WEP_VAPORIZER.m_id]) >= vaporizer_ammo;
                        return ammo_amount;
                }
                case WR_CHECKAMMO2:
@@ -219,7 +219,7 @@ float W_Vaporizer(float req)
                        if(!WEP_CVAR_SEC(vaporizer, ammo))
                                return true;
                        ammo_amount = self.WEP_AMMO(VAPORIZER) >= WEP_CVAR_SEC(vaporizer, ammo);
-                       ammo_amount += self.(weapon_load[WEP_VAPORIZER]) >= WEP_CVAR_SEC(vaporizer, ammo);
+                       ammo_amount += self.(weapon_load[WEP_VAPORIZER.m_id]) >= WEP_CVAR_SEC(vaporizer, ammo);
                        return ammo_amount;
                }
                case WR_CONFIG:
index d29264a1970df03df99f70bd1ae6d0d753ede662..0b0dc301397483be22d605ee17381e4a7c9d5736 100644 (file)
@@ -59,7 +59,7 @@ VORTEX_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 #endif
 #ifdef IMPLEMENTATION
 #ifdef SVQC
-void spawnfunc_weapon_vortex(void) { weapon_defaultspawnfunc(WEP_VORTEX); }
+void spawnfunc_weapon_vortex(void) { weapon_defaultspawnfunc(WEP_VORTEX.m_id); }
 void spawnfunc_weapon_nex(void) { spawnfunc_weapon_vortex(); }
 
 void SendCSQCVortexBeamParticle(float charge) {
@@ -111,7 +111,7 @@ void W_Vortex_Attack(float issecondary)
 
        yoda = 0;
        damage_goodhits = 0;
-       FireRailgunBullet(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, WEP_VORTEX);
+       FireRailgunBullet(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, WEP_VORTEX.m_id);
 
        if(yoda && flying)
                Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
@@ -215,7 +215,7 @@ bool W_Vortex(int req)
                                                                                        {
                                                                                                self.clip_load = max(WEP_CVAR_SEC(vortex, ammo), self.clip_load - WEP_CVAR_SEC(vortex, ammo) * dt);
                                                                                        }
-                                                                                       self.(weapon_load[WEP_VORTEX]) = self.clip_load;
+                                                                                       self.(weapon_load[WEP_VORTEX.m_id]) = self.clip_load;
                                                                                }
                                                                                else
                                                                                {
@@ -273,7 +273,7 @@ bool W_Vortex(int req)
                case WR_CHECKAMMO1:
                {
                        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));
+                       ammo_amount += (autocvar_g_balance_vortex_reload_ammo && self.(weapon_load[WEP_VORTEX.m_id]) >= WEP_CVAR_PRI(vortex, ammo));
                        return ammo_amount;
                }
                case WR_CHECKAMMO2:
@@ -282,7 +282,7 @@ bool W_Vortex(int req)
                        {
                                // don't allow charging if we don't have enough ammo
                                ammo_amount = self.WEP_AMMO(VORTEX) >= WEP_CVAR_SEC(vortex, ammo);
-                               ammo_amount += self.(weapon_load[WEP_VORTEX]) >= WEP_CVAR_SEC(vortex, ammo);
+                               ammo_amount += self.(weapon_load[WEP_VORTEX.m_id]) >= WEP_CVAR_SEC(vortex, ammo);
                                return ammo_amount;
                        }
                        else
index 9fa1667099b4b3ac017cde9987004d58dd082192..fcf1c04d29cda938cd5f8e3454bf1fc2150a13e7 100644 (file)
@@ -600,7 +600,7 @@ void havocbot_movetogoal()
                else if(self.health>WEP_CVAR(devastator, damage)*0.5)
                {
                        if(self.velocity.z < 0)
-                       if(client_hasweapon(self, WEP_DEVASTATOR, true, false))
+                       if(client_hasweapon(self, WEP_DEVASTATOR.m_id, true, false))
                        {
                                self.movement_x = maxspeed;
 
@@ -614,7 +614,7 @@ void havocbot_movetogoal()
                                        return;
                                }
 
-                               self.switchweapon = WEP_DEVASTATOR;
+                               self.switchweapon = WEP_DEVASTATOR.m_id;
                                self.v_angle_x = 90;
                                self.BUTTON_ATCK = true;
                                self.rocketjumptime = time + WEP_CVAR(devastator, detonatedelay);
@@ -930,7 +930,7 @@ void havocbot_chooseenemy()
 
                // I want to do a second scan if no enemy was found or I don't have weapons
                // TODO: Perform the scan when using the rifle (requires changes on the rifle code)
-               if(best || self.weapons) // || self.weapon == WEP_RIFLE
+               if(best || self.weapons) // || self.weapon == WEP_RIFLE.m_id
                        break;
                if(i)
                        break;
@@ -980,7 +980,7 @@ void havocbot_chooseweapon()
        // ;)
        if(g_weaponarena_weapons == WEPSET_TUBA)
        {
-               self.switchweapon = WEP_TUBA;
+               self.switchweapon = WEP_TUBA.m_id;
                return;
        }
 
@@ -989,7 +989,7 @@ void havocbot_chooseweapon()
        {
                // If no weapon was chosen get the first available weapon
                if(self.weapon==0)
-               for(i = WEP_FIRST; i <= WEP_LAST; ++i) if(i != WEP_BLASTER)
+               for(i = WEP_FIRST; i <= WEP_LAST; ++i) if(i != WEP_BLASTER.m_id)
                {
                        if(client_hasweapon(self, i, true, false))
                        {
index 6d3d786aecda1de1a1b2c70c697bcb3c3cc3b7a8..388650926821ba65c45e51d8e47d453e15e40076 100644 (file)
@@ -2367,7 +2367,7 @@ void PlayerPreThink (void)
 
                if(frametime)
                {
-                       if(self.weapon == WEP_VORTEX && WEP_CVAR(vortex, charge))
+                       if(self.weapon == WEP_VORTEX.m_id && WEP_CVAR(vortex, charge))
                        {
                                self.weaponentity_glowmod_x = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_half * min(1, self.vortex_charge / WEP_CVAR(vortex, charge_animlimit));
                                self.weaponentity_glowmod_y = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_half * min(1, self.vortex_charge / WEP_CVAR(vortex, charge_animlimit));
@@ -2463,7 +2463,7 @@ void PlayerPreThink (void)
 
                // WEAPONTODO: THIS SHIT NEEDS TO GO EVENTUALLY
                // It cannot be predicted by the engine!
-               if((self.weapon == WEP_SHOCKWAVE || self.weapon == WEP_SHOTGUN) && self.weaponentity.wframe == WFRAME_FIRE2 && time < self.weapon_nextthink)
+               if((self.weapon == WEP_SHOCKWAVE.m_id || self.weapon == WEP_SHOTGUN.m_id) && self.weaponentity.wframe == WFRAME_FIRE2 && time < self.weapon_nextthink)
                        do_crouch = 0;
 
                if (do_crouch)
@@ -2540,7 +2540,7 @@ void PlayerPreThink (void)
 
        // WEAPONTODO: Add weapon request for this
        if(!zoomstate_set)
-               SetZoomState(self.BUTTON_ZOOM || self.BUTTON_ZOOMSCRIPT || (self.BUTTON_ATCK2 && self.weapon == WEP_VORTEX) || (self.BUTTON_ATCK2 && self.weapon == WEP_RIFLE && WEP_CVAR(rifle, secondary) == 0)); // WEAPONTODO
+               SetZoomState(self.BUTTON_ZOOM || self.BUTTON_ZOOMSCRIPT || (self.BUTTON_ATCK2 && self.weapon == WEP_VORTEX.m_id) || (self.BUTTON_ATCK2 && self.weapon == WEP_RIFLE.m_id && WEP_CVAR(rifle, secondary) == 0)); // WEAPONTODO
 
        float oldspectatee_status;
        oldspectatee_status = self.spectatee_status;
index aae39ea66eccbc9e9190e1797fedcabee3e366de..8506099928e9d4c6d82829069b0e04e9fa1e4b32 100644 (file)
@@ -322,7 +322,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, int deathtyp
                        damage /= sqrt(bound(1.0, attacker.cvar_cl_handicap, 100.0));
        }
 
-       if(DEATH_ISWEAPON(deathtype, WEP_TUBA))
+       if(DEATH_ISWEAPON(deathtype, WEP_TUBA.m_id))
        {
                // tuba causes blood to come out of the ears
                vector ear1, ear2;
index c5bbfcab55ed0f132ece9d8e55d517afac328338..23b68231045eb84202bbcd9e9faec738903e5ed8 100644 (file)
@@ -107,7 +107,7 @@ void GiveFrags (entity attacker, entity targ, float f, int deathtype)
                else if(!(attacker.weapons & WepSet_FromWeapon(culprit)))
                        culprit = attacker.weapon;
 
-               if(g_weaponarena_random_with_blaster && culprit == WEP_BLASTER) // WEAPONTODO: Shouldn't this be in a mutator?
+               if(g_weaponarena_random_with_blaster && culprit == WEP_BLASTER.m_id) // WEAPONTODO: Shouldn't this be in a mutator?
                {
                        // no exchange
                }
@@ -651,7 +651,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                                        RemoveGrapplingHook(targ); // STOP THAT, you parasite!
 
        // special rule: gravity bomb does not hit team mates (other than for disconnecting the hook)
-       if(DEATH_ISWEAPON(deathtype, WEP_HOOK) || DEATH_ISWEAPON(deathtype, WEP_TUBA))
+       if(DEATH_ISWEAPON(deathtype, WEP_HOOK.m_id) || DEATH_ISWEAPON(deathtype, WEP_TUBA.m_id))
        {
                if(IS_PLAYER(targ))
                        if(SAME_TEAM(targ, attacker))
@@ -967,8 +967,8 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in
 
        total_damage_to_creatures = 0;
 
-       if(deathtype != (WEP_HOOK | HITTYPE_SECONDARY | HITTYPE_BOUNCE)) // only send gravity bomb damage once
-               if(DEATH_WEAPONOF(deathtype) != WEP_TUBA) // do not send tuba damage (bandwidth hog)
+       if(deathtype != (WEP_HOOK.m_id | HITTYPE_SECONDARY | HITTYPE_BOUNCE)) // only send gravity bomb damage once
+               if(DEATH_WEAPONOF(deathtype) != WEP_TUBA.m_id) // do not send tuba damage (bandwidth hog)
                {
                        force = inflictorvelocity;
                        if(vlen(force) == 0)
@@ -1029,7 +1029,7 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in
                                        force = force * (finaldmg / coredamage) * forceintensity;
                                        hitloc = nearest;
 
-                                       if(deathtype & WEP_BLASTER)
+                                       if(deathtype & WEP_BLASTER.m_id)
                                                force *= WEP_CVAR_BOTH(blaster, !(deathtype & HITTYPE_SECONDARY), force_zscale);
 
                                        if(targ != directhitentity)
index 7a127eddab3971938567faa9479a1f64c9930222..3fab00f0e1c9e9ea4025c00b43b1a50d48fb648b 100644 (file)
@@ -394,7 +394,7 @@ void FireGrapplingHook (void)
 
 void GrapplingHookFrame()
 {
-       if(g_grappling_hook && timeout_status != TIMEOUT_ACTIVE && self.weapon != WEP_HOOK)
+       if(g_grappling_hook && timeout_status != TIMEOUT_ACTIVE && self.weapon != WEP_HOOK.m_id)
        {
                // offhand hook controls
                if(self.BUTTON_HOOK)
@@ -423,14 +423,14 @@ void GrapplingHookFrame()
                        //self.hook_state &= ~HOOK_RELEASING;
                }
        }
-       else if(!g_grappling_hook && self.switchweapon != WEP_HOOK)
+       else if(!g_grappling_hook && self.switchweapon != WEP_HOOK.m_id)
        {
                if(self.BUTTON_HOOK && !self.hook_switchweapon)
-                       W_SwitchWeapon(WEP_HOOK);
+                       W_SwitchWeapon(WEP_HOOK.m_id);
        }
        self.hook_switchweapon = self.BUTTON_HOOK;
 
-       if(!g_grappling_hook && self.weapon != WEP_HOOK)
+       if(!g_grappling_hook && self.weapon != WEP_HOOK.m_id)
        {
                self.hook_state &= ~HOOK_FIRING;
                self.hook_state |= HOOK_REMOVING;
@@ -492,11 +492,11 @@ void GrappleHookInit()
        }
        else
        {
-               WEP_ACTION(WEP_HOOK, WR_INIT);
-               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);
-               hook_shotorigin[3] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_HOOK), false, false, 4);
+               WEP_ACTION(WEP_HOOK.m_id, WR_INIT);
+               hook_shotorigin[0] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_HOOK.m_id), false, false, 1);
+               hook_shotorigin[1] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_HOOK.m_id), false, false, 2);
+               hook_shotorigin[2] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_HOOK.m_id), false, false, 3);
+               hook_shotorigin[3] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_HOOK.m_id), false, false, 4);
        }
 }
 
index 2354e128e30bd9d1874e1ca0e57c16ec2f8c07d2..f8b29d2d4fc0946b1bdbbd3cdd8757ce31fb681b 100644 (file)
@@ -516,14 +516,14 @@ float want_weapon(entity weaponinfo, float allguns) // WEAPONTODO: what still ne
                        d = false;
        }
        else if (g_cts)
-               d = (i == WEP_SHOTGUN);
+               d = (i == WEP_SHOTGUN.m_id);
        else if (g_nexball)
                d = 0; // weapon is set a few lines later
        else
                d = !(!weaponinfo.weaponstart);
 
        if(g_grappling_hook) // if possible, redirect off-hand hook to on-hand hook
-               d |= (i == WEP_HOOK);
+               d |= (i == WEP_HOOK.m_id);
        if(!g_cts && (weaponinfo.spawnflags & WEP_FLAG_MUTATORBLOCKED)) // never default mutator blocked guns
                d = 0;
 
index 9844875b3d9eb27ac56efc69049e59aed1a70f2c..2fdde9883792c217b3f7151112b26d3318f17f97 100644 (file)
@@ -158,9 +158,9 @@ void GiveBall(entity plyr, entity ball)
        self.weaponentity.weapons = self.weapons;
        self.weaponentity.switchweapon = self.weapon;
        self.weapons = WEPSET_PORTO;
-       WEP_ACTION(WEP_PORTO, WR_RESETPLAYER);
-       self.switchweapon = WEP_PORTO;
-       W_SwitchWeapon(WEP_PORTO);
+       WEP_ACTION(WEP_PORTO.m_id, WR_RESETPLAYER);
+       self.switchweapon = WEP_PORTO.m_id;
+       W_SwitchWeapon(WEP_PORTO.m_id);
        self = ownr;
 }
 
@@ -873,7 +873,7 @@ float w_nexball_weapon(float req)
        }
        else if(req == WR_SETUP)
        {
-               //weapon_setup(WEP_PORTO);
+               //weapon_setup(WEP_PORTO.m_id);
        }
        // No need to check WR_CHECKAMMO* or WR_AIM, it should always return true
        return true;
@@ -936,7 +936,7 @@ MUTATOR_HOOKFUNCTION(nexball_PlayerPreThink)
                        if(self.weaponentity.weapons)
                        {
                                self.weapons = self.weaponentity.weapons;
-                               WEP_ACTION(WEP_PORTO, WR_RESETPLAYER);
+                               WEP_ACTION(WEP_PORTO.m_id, WR_RESETPLAYER);
                                self.switchweapon = self.weaponentity.switchweapon;
                                W_SwitchWeapon(self.switchweapon);
 
@@ -982,7 +982,7 @@ MUTATOR_HOOKFUNCTION(nexball_SetStartItems)
 
 MUTATOR_HOOKFUNCTION(nexball_ForbidThrowing)
 {
-       if(self.weapon == WEP_MORTAR)
+       if(self.weapon == WEP_MORTAR.m_id)
                return true;
 
        return false;
@@ -991,7 +991,7 @@ MUTATOR_HOOKFUNCTION(nexball_ForbidThrowing)
 MUTATOR_HOOKFUNCTION(nexball_FilterItem)
 {
        if(self.classname == "droppedweapon")
-       if(self.weapon == WEP_MORTAR)
+       if(self.weapon == WEP_MORTAR.m_id)
                return true;
 
        return false;
index 170f59874fbb45803574bd10bd35d9993542946d..0f483abaf89aabd0f93956068403699008d33d97 100644 (file)
@@ -469,7 +469,7 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerDamage_Calculate)
                frag_target.buff_disability_time = time + autocvar_g_buffs_disability_slowtime;
 
        if(frag_attacker.buffs & BUFF_MEDIC.m_itemid)
-       if(DEATH_WEAPONOF(frag_deathtype) != WEP_ARC)
+       if(DEATH_WEAPONOF(frag_deathtype) != WEP_ARC.m_id)
        if(SAME_TEAM(frag_attacker, frag_target))
        if(frag_attacker != frag_target)
        {
@@ -493,7 +493,7 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerDamage_Calculate)
        // this... is ridiculous (TODO: fix!)
        if(frag_attacker.buffs & BUFF_VAMPIRE.m_itemid)
        if(!frag_target.vehicle)
-       if(DEATH_WEAPONOF(frag_deathtype) != WEP_ARC)
+       if(DEATH_WEAPONOF(frag_deathtype) != WEP_ARC.m_id)
        if(!ITEM_DAMAGE_NEEDKILL(frag_deathtype))
        if(frag_target.deadflag == DEAD_NO)
        if(IS_PLAYER(frag_target) || (frag_target.flags & FL_MONSTER))
index b2d9ee26937c68a56229ff65d6b0500db855287e..cd2cc4a6bee093c337a8ca61d72dea4293f360c3 100644 (file)
@@ -250,7 +250,7 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerDamage)
                }
 
                if(IS_PLAYER(frag_attacker))
-               if(DEATH_ISWEAPON(frag_deathtype, WEP_VAPORIZER))
+               if(DEATH_ISWEAPON(frag_deathtype, WEP_VAPORIZER.m_id))
                {
                        if(frag_target.armorvalue)
                        {
@@ -262,7 +262,7 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerDamage)
                        }
                }
 
-               if(IS_PLAYER(frag_attacker) && DEATH_ISWEAPON(frag_deathtype, WEP_BLASTER))
+               if(IS_PLAYER(frag_attacker) && DEATH_ISWEAPON(frag_deathtype, WEP_BLASTER.m_id))
                {
                        if(frag_deathtype & HITTYPE_SECONDARY)
                        {
@@ -319,13 +319,13 @@ MUTATOR_HOOKFUNCTION(instagib_FilterItem)
        if(self.classname == "item_cells")
                return true; // no normal cells?
 
-       if(self.weapon == WEP_VAPORIZER && self.classname == "droppedweapon")
+       if(self.weapon == WEP_VAPORIZER.m_id && self.classname == "droppedweapon")
        {
                self.ammo_cells = autocvar_g_instagib_ammo_drop;
                return false;
        }
 
-       if(self.weapon == WEP_DEVASTATOR || self.weapon == WEP_VORTEX)
+       if(self.weapon == WEP_DEVASTATOR.m_id || self.weapon == WEP_VORTEX.m_id)
        {
                entity e = spawn();
                setorigin(e, self.origin);
index f4267716e7bbfa860b8b2fc7f4cfee28be2703b2..a164bd1ceae76fb1f55fa59866bb441721ee4072 100644 (file)
@@ -608,28 +608,28 @@ void nade_damage(entity inflictor, entity attacker, float damage, int deathtype,
        if(self.nade_type == NADE_TYPE_TRANSLOCATE.m_id || self.nade_type == NADE_TYPE_SPAWN.m_id)
                return;
 
-       if(DEATH_ISWEAPON(deathtype, WEP_BLASTER))
+       if(DEATH_ISWEAPON(deathtype, WEP_BLASTER.m_id))
        {
                force *= 1.5;
                damage = 0;
        }
 
-       if(DEATH_ISWEAPON(deathtype, WEP_VAPORIZER) && (deathtype & HITTYPE_SECONDARY))
+       if(DEATH_ISWEAPON(deathtype, WEP_VAPORIZER.m_id) && (deathtype & HITTYPE_SECONDARY))
        {
                force *= 0.5; // too much
                frag_damage = 0;
        }
 
-       if(DEATH_ISWEAPON(deathtype, WEP_VORTEX) || DEATH_ISWEAPON(deathtype, WEP_VAPORIZER))
+       if(DEATH_ISWEAPON(deathtype, WEP_VORTEX.m_id) || DEATH_ISWEAPON(deathtype, WEP_VAPORIZER.m_id))
        {
                force *= 6;
                damage = self.max_health * 0.55;
        }
 
-       if(DEATH_ISWEAPON(deathtype, WEP_MACHINEGUN) || DEATH_ISWEAPON(deathtype, WEP_HMG))
+       if(DEATH_ISWEAPON(deathtype, WEP_MACHINEGUN.m_id) || DEATH_ISWEAPON(deathtype, WEP_HMG.m_id))
                damage = self.max_health * 0.1;
 
-       if(DEATH_ISWEAPON(deathtype, WEP_SHOCKWAVE) || DEATH_ISWEAPON(deathtype, WEP_SHOTGUN)) // WEAPONTODO
+       if(DEATH_ISWEAPON(deathtype, WEP_SHOCKWAVE.m_id) || DEATH_ISWEAPON(deathtype, WEP_SHOTGUN.m_id)) // WEAPONTODO
        if(deathtype & HITTYPE_SECONDARY)
        {
                damage = self.max_health * 0.1;
@@ -929,7 +929,7 @@ MUTATOR_HOOKFUNCTION(nades_PlayerPreThink)
        float key_pressed = self.BUTTON_HOOK;
        float time_score;
 
-       if(g_grappling_hook || client_hasweapon(self, WEP_HOOK, false, false) || (weaponsInMap & WEPSET_HOOK))
+       if(g_grappling_hook || client_hasweapon(self, WEP_HOOK.m_id, false, false) || (weaponsInMap & WEPSET_HOOK))
                key_pressed = self.button16; // if hook is enabled, use an alternate key
 
        if(self.nade)
index d52bd09ee32c68ddd70a332ca62bd139f4b287c7..78875cb70f20227bbdb1d995cfc982522e05717c 100644 (file)
@@ -87,11 +87,11 @@ float nt_IsNewToy(float w)
 {
        switch(w)
        {
-               case WEP_SEEKER:
-               case WEP_MINE_LAYER:
-               case WEP_HLAC:
-               case WEP_RIFLE:
-               case WEP_SHOCKWAVE:
+               case WEP_SEEKER.m_id:
+               case WEP_MINE_LAYER.m_id:
+               case WEP_HLAC.m_id:
+               case WEP_RIFLE.m_id:
+               case WEP_SHOCKWAVE.m_id:
                        return true;
                default:
                        return false;
index 42a490b00e8befbf5bc4542200ecc86358155ec1..aa3ff38f8eaf97d3bf1b4749397d00c0c9d26830 100644 (file)
@@ -24,7 +24,7 @@ float NIX_CanChooseWeapon(float wpn)
        }
        else
        {
-               if(wpn == WEP_BLASTER && g_nix_with_blaster) // WEAPONTODO: rename to g_nix_with_blaster
+               if(wpn == WEP_BLASTER.m_id && g_nix_with_blaster) // WEAPONTODO: rename to g_nix_with_blaster
                        return false;
                if(e.spawnflags & WEP_FLAG_MUTATORBLOCKED)
                        return false;
index 39b244a724ef97116cf988d0d186730cd72ae497..3659255ac7f5f3f1270054de8cd9bbcd88645959 100644 (file)
@@ -46,7 +46,7 @@ float ok_CheckWeaponCharge(entity ent, int wep)
 MUTATOR_HOOKFUNCTION(ok_PlayerDamage_Calculate)
 {
        if(IS_PLAYER(frag_attacker) && IS_PLAYER(frag_target))
-       if(DEATH_ISWEAPON(frag_deathtype, WEP_BLASTER))
+       if(DEATH_ISWEAPON(frag_deathtype, WEP_BLASTER.m_id))
        {
                frag_damage = 0;
 
@@ -148,9 +148,9 @@ MUTATOR_HOOKFUNCTION(ok_PlayerPreThink)
                makevectors(self.v_angle);
 
                int oldwep = self.weapon;
-               self.weapon = WEP_BLASTER;
+               self.weapon = WEP_BLASTER.m_id;
                W_Blaster_Attack(
-                       WEP_BLASTER | HITTYPE_SECONDARY,
+                       WEP_BLASTER.m_id | HITTYPE_SECONDARY,
                        WEP_CVAR_SEC(vaporizer, shotangle),
                        WEP_CVAR_SEC(vaporizer, damage),
                        WEP_CVAR_SEC(vaporizer, edgedamage),
@@ -275,8 +275,8 @@ MUTATOR_HOOKFUNCTION(ok_StartItems)
 {
        WepSet ok_start_items = (WEPSET_MACHINEGUN | WEPSET_VORTEX | WEPSET_SHOTGUN);
 
-       if((get_weaponinfo(WEP_RPC)).weaponstart > 0) { ok_start_items |= WEPSET_RPC; }
-       if((get_weaponinfo(WEP_HMG)).weaponstart > 0) { ok_start_items |= WEPSET_HMG; }
+       if((get_weaponinfo(WEP_RPC.m_id)).weaponstart > 0) { ok_start_items |= WEPSET_RPC; }
+       if((get_weaponinfo(WEP_HMG.m_id)).weaponstart > 0) { ok_start_items |= WEPSET_HMG; }
 
        start_items |= IT_UNLIMITED_WEAPON_AMMO;
        start_weapons = warmup_start_weapons = ok_start_items;
@@ -334,12 +334,12 @@ void ok_Initialize()
        addstat(STAT_OK_AMMO_CHARGE, AS_FLOAT, ok_use_ammocharge);
        addstat(STAT_OK_AMMO_CHARGEPOOL, AS_FLOAT, ok_ammo_charge);
 
-       (get_weaponinfo(WEP_RPC)).spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
-       (get_weaponinfo(WEP_HMG)).spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
+       (get_weaponinfo(WEP_RPC.m_id)).spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
+       (get_weaponinfo(WEP_HMG.m_id)).spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
 
-       (get_weaponinfo(WEP_SHOTGUN)).mdl = "ok_shotgun";
-       (get_weaponinfo(WEP_MACHINEGUN)).mdl = "ok_mg";
-       (get_weaponinfo(WEP_VORTEX)).mdl = "ok_sniper";
+       (get_weaponinfo(WEP_SHOTGUN.m_id)).mdl = "ok_shotgun";
+       (get_weaponinfo(WEP_MACHINEGUN.m_id)).mdl = "ok_mg";
+       (get_weaponinfo(WEP_VORTEX.m_id)).mdl = "ok_sniper";
 }
 
 MUTATOR_DEFINITION(mutator_overkill)
@@ -367,8 +367,8 @@ MUTATOR_DEFINITION(mutator_overkill)
 
        MUTATOR_ONREMOVE
        {
-               (get_weaponinfo(WEP_RPC)).spawnflags |= WEP_FLAG_MUTATORBLOCKED;
-               (get_weaponinfo(WEP_HMG)).spawnflags |= WEP_FLAG_MUTATORBLOCKED;
+               (get_weaponinfo(WEP_RPC.m_id)).spawnflags |= WEP_FLAG_MUTATORBLOCKED;
+               (get_weaponinfo(WEP_HMG.m_id)).spawnflags |= WEP_FLAG_MUTATORBLOCKED;
        }
 
        return false;
index e6a0f9c0e4887ef1e37971d7a142b33aa3ea9ab0..cf9695a94b091dccc39bc325d438f8519adb41ba 100644 (file)
@@ -904,19 +904,19 @@ void vehicles_damage(entity inflictor, entity attacker, float damage, int deatht
     self.dmg_time = time;
 
        // WEAPONTODO
-    if(DEATH_ISWEAPON(deathtype, WEP_VORTEX))
+    if(DEATH_ISWEAPON(deathtype, WEP_VORTEX.m_id))
         damage *= autocvar_g_vehicles_vortex_damagerate;
 
-    if(DEATH_ISWEAPON(deathtype, WEP_MACHINEGUN))
+    if(DEATH_ISWEAPON(deathtype, WEP_MACHINEGUN.m_id))
         damage *= autocvar_g_vehicles_machinegun_damagerate;
 
-    if(DEATH_ISWEAPON(deathtype, WEP_RIFLE))
+    if(DEATH_ISWEAPON(deathtype, WEP_RIFLE.m_id))
         damage *= autocvar_g_vehicles_rifle_damagerate;
 
-    if(DEATH_ISWEAPON(deathtype, WEP_VAPORIZER))
+    if(DEATH_ISWEAPON(deathtype, WEP_VAPORIZER.m_id))
         damage *= autocvar_g_vehicles_vaporizer_damagerate;
 
-    if(DEATH_ISWEAPON(deathtype, WEP_SEEKER))
+    if(DEATH_ISWEAPON(deathtype, WEP_SEEKER.m_id))
         damage *= autocvar_g_vehicles_tag_damagerate;
 
     self.enemy = attacker;
index 89c4253a13f125d6a0e4c0d97aa6920de1c2a9db..94093438c7213336a8ae0e791c17c334c3d79eb9 100644 (file)
@@ -26,7 +26,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
        if(time < self.hasweapon_complain_spam)
                complain = 0;
 
-       if(wpn == WEP_HOOK && !g_grappling_hook && autocvar_g_nades && !((cl.weapons | weaponsInMap) & WepSet_FromWeapon(wpn)))
+       if(wpn == WEP_HOOK.m_id && !g_grappling_hook && autocvar_g_nades && !((cl.weapons | weaponsInMap) & WepSet_FromWeapon(wpn)))
                complain = 0;
 
        if(complain)
@@ -55,7 +55,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
 
                                // always allow selecting the Mine Layer if we placed mines, so that we can detonate them
                                entity mine;
-                               if(wpn == WEP_MINE_LAYER)
+                               if(wpn == WEP_MINE_LAYER.m_id)
                                for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.owner == self)
                                        f = 1;
 
index d14bcfd1cfdec2d48aacdef8a572f0af9b0b0dd8..89ec52f2179f5114230addfe9eb567aa6909c55a 100644 (file)
@@ -144,7 +144,7 @@ float W_IsWeaponThrowable(float w)
                return 0;
        if (g_cts)
                return 0;
-       if (g_nexball && w == WEP_MORTAR)
+       if (g_nexball && w == WEP_MORTAR.m_id)
                return 0;
     if(w == 0)
         return 0;
index 98cbb2ba872a10794dc057693612c108163ec23e..49f6fdde73a51115762ff01f882b42cea485ee40 100644 (file)
@@ -25,7 +25,7 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector m
        float oldsolid;
        vector vecs, dv;
        oldsolid = ent.dphitcontentsmask;
-       if(ent.weapon == WEP_RIFLE)
+       if(ent.weapon == WEP_RIFLE.m_id)
                ent.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_CORPSE;
        else
                ent.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
@@ -273,7 +273,7 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f
        //explosion = spawn();
 
        // Find all non-hit players the beam passed close by
-       if(deathtype == WEP_VAPORIZER || deathtype == WEP_VORTEX)
+       if(deathtype == WEP_VAPORIZER.m_id || deathtype == WEP_VORTEX.m_id)
        {
                FOR_EACH_REALCLIENT(msg_entity)
                if(msg_entity != self)
index 4f072c4c085bb7e829c6355da495a14c0ad33888..a2d924c95146cebdef5579e0dc8cffca8b419971 100644 (file)
@@ -476,11 +476,11 @@ float weapon_prepareattack_checkammo(float secondary)
        {
                // always keep the Mine Layer if we placed mines, so that we can detonate them
                entity mine;
-               if(self.weapon == WEP_MINE_LAYER)
+               if(self.weapon == WEP_MINE_LAYER.m_id)
                for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.owner == self)
                        return false;
 
-               if(self.weapon == WEP_SHOTGUN)
+               if(self.weapon == WEP_SHOTGUN.m_id)
                if(!secondary && WEP_CVAR(shotgun, secondary) == 1)
                        return false; // no clicking, just allow
 
@@ -641,7 +641,7 @@ void weapon_thinkf(float fr, float t, void() func)
 
        if((fr == WFRAME_FIRE1 || fr == WFRAME_FIRE2) && t)
        {
-               if((self.weapon == WEP_SHOCKWAVE || self.weapon == WEP_SHOTGUN) && fr == WFRAME_FIRE2)
+               if((self.weapon == WEP_SHOCKWAVE.m_id || self.weapon == WEP_SHOTGUN.m_id) && fr == WFRAME_FIRE2)
                        animdecide_setaction(self, ANIMACTION_MELEE, restartanim);
                else
                        animdecide_setaction(self, ANIMACTION_SHOOT, restartanim);