]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'Mario/intrusive' into 'master'
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 6 Aug 2016 06:35:07 +0000 (06:35 +0000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 6 Aug 2016 06:35:07 +0000 (06:35 +0000)
Merge branch Mario/intrusive (L merge request)

Moves a few more entities to the new intrusive list system, further improving performance.

See merge request !344

30 files changed:
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/monsters/monster/shambler.qc
qcsrc/common/monsters/monster/spider.qc
qcsrc/common/monsters/monster/wyvern.qc
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/mutators/mutator/overkill/rpc.qc
qcsrc/common/turrets/sv_turrets.qc
qcsrc/common/turrets/turret/hellion_weapon.qc
qcsrc/common/turrets/turret/walker.qc
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/vehicle/raptor.qc
qcsrc/common/weapons/weapon/blaster.qc
qcsrc/common/weapons/weapon/crylink.qc
qcsrc/common/weapons/weapon/devastator.qc
qcsrc/common/weapons/weapon/electro.qc
qcsrc/common/weapons/weapon/fireball.qc
qcsrc/common/weapons/weapon/hagar.qc
qcsrc/common/weapons/weapon/hlac.qc
qcsrc/common/weapons/weapon/hook.qc
qcsrc/common/weapons/weapon/minelayer.qc
qcsrc/common/weapons/weapon/mortar.qc
qcsrc/common/weapons/weapon/porto.qc
qcsrc/common/weapons/weapon/seeker.qc
qcsrc/common/weapons/weapon/vaporizer.qc
qcsrc/server/defs.qh
qcsrc/server/g_hook.qc
qcsrc/server/mutators/mutator/gamemode_assault.qc
qcsrc/server/weapons/selection.qc
qcsrc/server/weapons/weaponsystem.qc

index 8e632f7c7ebd1524bd9f3a74689486c868e4a838..b65b558fdb1027352b45ab0bca37dc1a104b6b23 100644 (file)
@@ -837,6 +837,7 @@ void W_Nexball_Attack2(entity actor)
 
        missile.effects = EF_BRIGHTFIELD | EF_LOWPRECISION;
        missile.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, missile);
 
        CSQCProjectile(missile, true, PROJECTILE_ELECTRO, true);
 }
index 3d82bb686e5eebd661cc061389f619522454be28..02a01eff9efee4ea36dca28b26e29a32f9b064a1 100644 (file)
@@ -235,6 +235,7 @@ void M_Mage_Attack_Spike(entity this, vector dir)
        missile.solid = SOLID_BBOX;
        set_movetype(missile, MOVETYPE_FLYMISSILE);
        missile.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, missile);
        setorigin(missile, this.origin + v_forward * 14 + '0 0 30' + v_right * -14);
        setsize(missile, '0 0 0', '0 0 0');
        missile.velocity = dir * 400;
index afbb954c0b3590f7f42925b7525570ddb8e7256e..3018741b09be4b64e1bba83abebcc1065e896311 100644 (file)
@@ -173,6 +173,7 @@ void M_Shambler_Attack_Lightning(entity this)
 
        gren.angles = vectoangles (gren.velocity);
        gren.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, gren);
 
        CSQCProjectile(gren, true, PROJECTILE_SHAMBLER_LIGHTNING, true);
 }
index 543c99bf13bfb638471fbc508e1f91308cde5278..0270119cff01c7816b5c630b058099dc81509b01 100644 (file)
@@ -194,6 +194,7 @@ void M_Spider_Attack_Web(entity this)
        proj.health = 500;
        proj.event_damage = func_null;
        proj.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, proj);
        proj.damagedbycontents = true;
 
        proj.bouncefactor = 0.3;
index 805eb41451d0a072aa2c15b3a3cbccd20eae27a3..5d2103b6aed03243a5504008cd1f4efa556a8d3a 100644 (file)
@@ -69,6 +69,7 @@ METHOD(WyvernAttack, wr_think, void(WyvernAttack thiswep, entity actor, .entity
                setsize(missile, '-6 -6 -6', '6 6 6');
                setorigin(missile, actor.origin + actor.view_ofs + v_forward * 14);
                missile.flags = FL_PROJECTILE;
+        IL_PUSH(g_projectiles, missile);
                missile.velocity = w_shotdir * (autocvar_g_monster_wyvern_attack_fireball_speed);
                missile.avelocity = '300 300 300';
                missile.nextthink = time + 5;
index 38510ac00d6ed61cd6e759c2680a9bcc7082c9b3..14e2b01ac089706b6cd01f2ed8f4647f0e56692e 100644 (file)
@@ -294,6 +294,7 @@ void nade_napalm_ball(entity this)
 
        proj.angles = vectoangles(proj.velocity);
        proj.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, proj);
        proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC;
 
        //CSQCProjectile(proj, true, PROJECTILE_NAPALM_FIRE, true);
@@ -941,6 +942,7 @@ void toss_nade(entity e, bool set_owner, vector _velocity, float _time)
        _nade.damagedbycontents = true;
        _nade.angles = vectoangles(_nade.velocity);
        _nade.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, _nade);
        _nade.projectiledeathtype = DEATH_NADE.m_id;
        _nade.toss_time = time;
        _nade.solid = SOLID_CORPSE; //((_nade.nade_type == NADE_TYPE_TRANSLOCATE) ? SOLID_CORPSE : SOLID_BBOX);
index bd1386cd0a76b9cc67203d8323b39cc3884e31b0..d9e68f20f2a9b79ea5b8a21f5f7258e455291479 100644 (file)
@@ -143,6 +143,7 @@ void W_RocketPropelledChainsaw_Attack (Weapon thiswep, entity actor)
        missile.cnt = time + WEP_CVAR(rpc, lifetime);
        missile.nextthink = time;
        missile.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, missile);
 
        CSQCProjectile(missile, true, PROJECTILE_RPC, false);
 
index 417057841eaff7edcb907511214475b86c068195..f1515d070a96fdd55dfd92321dcea1e2fbd814e9 100644 (file)
@@ -476,7 +476,8 @@ entity turret_projectile(entity actor, Sound _snd, float _size, float _health, f
        proj.nextthink    = time + 9;
        set_movetype(proj, MOVETYPE_FLYMISSILE);
        proj.velocity           = normalize(actor.tur_shotdir_updated + randomvec() * actor.shot_spread) * actor.shot_speed;
-       proj.flags                = FL_PROJECTILE;
+       proj.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, proj);
        proj.enemy                = actor.enemy;
        proj.totalfrags  = _death;
        PROJECTILE_MAKETRIGGER(proj);
@@ -1199,7 +1200,8 @@ void turrets_manager_think(entity this)
 
        if (autocvar_g_turrets_reloadcvars == 1)
        {
-               FOREACH_ENTITY_FLAGS(turret_flags, TUR_FLAG_ISTURRET, {
+               IL_EACH(g_turrets, true,
+               {
                        load_unit_settings(it, true);
                        Turret tur = get_turretinfo(it.m_id);
                        tur.tr_think(tur, it);
@@ -1248,6 +1250,7 @@ bool turret_initialize(entity this, Turret tur)
        // if tur_head exists, we can assume this turret re-spawned
        if(!this.tur_head) {
                tur.tr_precache(tur);
+               IL_PUSH(g_turrets, this);
        }
 
        entity e = find(NULL, classname, "turret_manager");
index 9e737ea6cf12e921fb2e48828b739ef382a5f0e3..bc8e581e084061c656037bd8a1a2a2dfc087d836 100644 (file)
@@ -33,7 +33,6 @@ METHOD(HellionAttack, wr_think, void(entity thiswep, entity actor, .entity weapo
         te_explosion (missile.origin);
         setthink(missile, turret_hellion_missile_think);
         missile.nextthink      = time;
-        missile.flags          = FL_PROJECTILE;
         missile.max_health   = time + 9;
         missile.tur_aimpos   = randomvec() * 128;
         missile.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_GUIDED_HEAT;
index 50f468a7452bb530739ae4a6e8c9d9def938f0ef..ff2ce88c7d8b8cd19553707e4c3d56333276bac8 100644 (file)
@@ -259,7 +259,8 @@ void walker_fire_rocket(entity this, vector org)
     rocket.velocity               = normalize((v_forward + v_up * 0.5) + (randomvec() * 0.2)) * (autocvar_g_turrets_unit_walker_rocket_speed);
     rocket.angles                       = vectoangles(rocket.velocity);
     settouch(rocket, walker_rocket_touch);
-    rocket.flags                         = FL_PROJECTILE;
+    rocket.flags = FL_PROJECTILE;
+    IL_PUSH(g_projectiles, rocket);
     rocket.solid                         = SOLID_BBOX;
     rocket.max_health           = time + 9;
     rocket.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_GUIDED_HEAT;
index e529d4ad703680954d18b11acd74e480e7696065..9f02cf21bcecfd5992ca151f81613d5ef6006416 100644 (file)
@@ -247,7 +247,8 @@ entity vehicles_projectile(entity this, string _mzlfx, Sound _mzlsound,
        proj.totalfrags    = _deahtype;
        proj.solid                      = SOLID_BBOX;
        set_movetype(proj, MOVETYPE_FLYMISSILE);
-       proj.flags                      = FL_PROJECTILE;
+       proj.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, proj);
        proj.bot_dodge          = true;
        proj.bot_dodgerating  = _dmg;
        proj.velocity            = _vel;
@@ -265,7 +266,7 @@ entity vehicles_projectile(entity this, string _mzlfx, Sound _mzlsound,
                proj.health                = _health;
        }
        else
-               proj.flags                 = FL_PROJECTILE | FL_NOTARGET;
+               proj.flags |= FL_NOTARGET;
 
        if(_mzlsound != SND_Null)
                sound (this, CH_WEAPON_A, _mzlsound, VOL_BASE, ATTEN_NORM);
@@ -1115,7 +1116,10 @@ bool vehicle_initialize(entity this, Vehicle info, bool nodrop)
                return false;
 
        if(!this.tur_head)
+       {
                info.vr_precache(info);
+               IL_PUSH(g_vehicles, this);
+       }
 
        if(this.targetname && this.targetname != "")
        {
index 04c985c31f4dbb62910d724a58003b157e919a2d..6b33f8c1a3b7837cba0f340206225ac41f811bf9 100644 (file)
@@ -430,9 +430,8 @@ bool raptor_frame(entity this)
        if(vehic.bomb1.cnt < time)
        {
                bool incoming = false;
-               FOREACH_ENTITY_ENT(enemy, vehic,
+               IL_EACH(g_projectiles, it.enemy == vehic,
                {
-                       if(it.flags & FL_PROJECTILE)
                        if(MISSILE_IS_TRACKING(it))
                        if(vdist(vehic.origin - it.origin, <, 2 * autocvar_g_vehicle_raptor_flare_range))
                        {
index 42818169ba324eab3688f28b652428473d39a24f..0c3765a13955fc6b1ce56e03b89f9345fed32da3 100644 (file)
@@ -137,6 +137,7 @@ void W_Blaster_Attack(
 
        settouch(missile, W_Blaster_Touch);
        missile.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, missile);
        missile.missile_flags = MIF_SPLASH;
        missile.projectiledeathtype = atk_deathtype;
        setthink(missile, W_Blaster_Think);
index eb35652ab6c2414ca4cbcd2ff91c3e251db36eda..bb782643a67bb6ace6a5fd5196c93e2786cf8ac8 100644 (file)
@@ -439,6 +439,7 @@ void W_Crylink_Attack(Weapon thiswep, entity actor)
                //proj.glow_size = 20;
 
                proj.flags = FL_PROJECTILE;
+               IL_PUSH(g_projectiles, proj);
                proj.missile_flags = MIF_SPLASH;
 
                CSQCProjectile(proj, true, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), true);
@@ -554,6 +555,7 @@ void W_Crylink_Attack2(Weapon thiswep, entity actor)
                //proj.glow_size = 20;
 
                proj.flags = FL_PROJECTILE;
+               IL_PUSH(g_projectiles, proj);
         proj.missile_flags = MIF_SPLASH;
 
                CSQCProjectile(proj, true, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), true);
index 4eba16e9790676965c3904d376420e88cc187ed4..870ced3d9c1c713d0ea2f0b2e2882516b3f670d1 100644 (file)
@@ -390,6 +390,7 @@ void W_Devastator_Attack(Weapon thiswep, entity actor)
        missile.nextthink = time;
        missile.cnt = time + WEP_CVAR(devastator, lifetime);
        missile.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, missile);
        missile.missile_flags = MIF_SPLASH;
 
        CSQCProjectile(missile, WEP_CVAR(devastator, guiderate) == 0 && WEP_CVAR(devastator, speedaccel) == 0, PROJECTILE_ROCKET, false); // because of fly sound
index 643848549754910515b35a92734503865b580ba8..5f8208a7ff6419ee9b82819f0df179030bee9afa 100644 (file)
@@ -298,6 +298,7 @@ void W_Electro_Attack_Bolt(Weapon thiswep, entity actor)
        settouch(proj, W_Electro_TouchExplode);
        setsize(proj, '0 0 -3', '0 0 -3');
        proj.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, proj);
        proj.missile_flags = MIF_SPLASH;
 
        CSQCProjectile(proj, true, PROJECTILE_ELECTRO_BEAM, true);
@@ -443,6 +444,7 @@ void W_Electro_Attack_Orb(Weapon thiswep, entity actor)
        proj.health = WEP_CVAR_SEC(electro, health);
        proj.event_damage = W_Electro_Orb_Damage;
        proj.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, proj);
        proj.damagedbycontents = (WEP_CVAR_SEC(electro, damagedbycontents));
 
        proj.bouncefactor = WEP_CVAR_SEC(electro, bouncefactor);
index ab3ebb9340626f202b677047dfaed39b1467093e..a523354a021ee6f6e2e4d6cc80e28b16dd8c27a3 100644 (file)
@@ -224,6 +224,7 @@ void W_Fireball_Attack1(entity actor)
        settouch(proj, W_Fireball_TouchExplode);
        setsize(proj, '-16 -16 -16', '16 16 16');
        proj.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, proj);
     proj.missile_flags = MIF_SPLASH | MIF_PROXY;
 
        CSQCProjectile(proj, true, PROJECTILE_FIREBALL, true);
@@ -354,6 +355,7 @@ void W_Fireball_Attack2(entity actor)
 
        proj.angles = vectoangles(proj.velocity);
        proj.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, proj);
     proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC;
 
        CSQCProjectile(proj, true, PROJECTILE_FIREMINE, true);
index c7e30d2357f8eccde21aa4efe079491349bc62b2..7d45dc8b824d0b5d31145589abb69b7acfcbfed3 100644 (file)
@@ -169,6 +169,7 @@ void W_Hagar_Attack(Weapon thiswep, entity actor)
 
        missile.angles = vectoangles(missile.velocity);
        missile.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, missile);
        missile.missile_flags = MIF_SPLASH;
 
        CSQCProjectile(missile, true, PROJECTILE_HAGAR, true);
@@ -212,6 +213,7 @@ void W_Hagar_Attack2(Weapon thiswep, entity actor)
 
        missile.angles = vectoangles(missile.velocity);
        missile.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, missile);
        missile.missile_flags = MIF_SPLASH;
 
        CSQCProjectile(missile, true, PROJECTILE_HAGAR_BOUNCING, true);
@@ -288,6 +290,7 @@ void W_Hagar_Attack2_Load_Release(entity actor, .entity weaponentity)
 
                missile.angles = vectoangles(missile.velocity);
                missile.flags = FL_PROJECTILE;
+               IL_PUSH(g_projectiles, missile);
 
                CSQCProjectile(missile, true, PROJECTILE_HAGAR, true);
 
index 1ecc3f0ffe5431921f760ad472e343b2a173a497..64c87c8a0639eccdcc79249b710d3723350c2654 100644 (file)
@@ -110,6 +110,7 @@ void W_HLAC_Attack(Weapon thiswep, entity actor)
     missile.nextthink = time + WEP_CVAR_PRI(hlac, lifetime);
 
        missile.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, missile);
        missile.projectiledeathtype = WEP_HLAC.m_id;
 
        CSQCProjectile(missile, true, PROJECTILE_HLAC, true);
@@ -152,6 +153,7 @@ void W_HLAC_Attack2(entity actor)
     missile.nextthink = time + WEP_CVAR_SEC(hlac, lifetime);
 
        missile.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, missile);
        missile.missile_flags = MIF_SPLASH;
        missile.projectiledeathtype = WEP_HLAC.m_id | HITTYPE_SECONDARY;
 
index d68fef13d2c19eea579ed36e171da798b7d3ed53..e9200e762656d2d01d948026f6fec7feb85e4bfb 100644 (file)
@@ -179,6 +179,7 @@ void W_Hook_Attack2(Weapon thiswep, entity actor)
 
        gren.angles = '0 0 0';
        gren.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, gren);
 
        CSQCProjectile(gren, true, PROJECTILE_HOOKBOMB, true);
 
index b4b38031fc80deda3690cbac489c2dc21e13a94f..e5ba64f2464068102c2b5f568087c739eca3836c 100644 (file)
@@ -70,6 +70,7 @@ void W_MineLayer_Stick(entity this, entity to)
        // in order for mines to face properly when sticking to the ground, they must be a server side entity rather than a csqc projectile
 
        entity newmine = spawn();
+       IL_PUSH(g_mines, newmine);
        newmine.classname = this.classname;
 
        newmine.bot_dodge = this.bot_dodge;
@@ -101,6 +102,7 @@ void W_MineLayer_Stick(entity this, entity to)
        newmine.nextthink = time;
        newmine.cnt = this.cnt;
        newmine.flags = this.flags;
+       IL_PUSH(g_projectiles, newmine);
 
        delete(this);
 
@@ -203,9 +205,10 @@ void W_MineLayer_ProximityExplode(entity this)
 int W_MineLayer_Count(entity e)
 {
        int minecount = 0;
-       entity mine;
-       for(mine = NULL; (mine = find(mine, classname, "mine")); ) if(mine.realowner == e)
+       IL_EACH(g_mines, it.realowner == e,
+       {
                minecount += 1;
+       });
 
        return minecount;
 }
@@ -335,6 +338,7 @@ void W_MineLayer_Attack(Weapon thiswep, entity actor)
        Send_Effect(EFFECT_ROCKET_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        mine = WarpZone_RefSys_SpawnSameRefSys(actor);
+       IL_PUSH(g_mines, mine);
        mine.owner = mine.realowner = actor;
        if(WEP_CVAR(minelayer, detonatedelay) >= 0)
                mine.spawnshieldtime = time + WEP_CVAR(minelayer, detonatedelay);
@@ -364,6 +368,7 @@ void W_MineLayer_Attack(Weapon thiswep, entity actor)
        mine.nextthink = time;
        mine.cnt = (WEP_CVAR(minelayer, lifetime) - WEP_CVAR(minelayer, lifetime_countdown));
        mine.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, mine);
        mine.missile_flags = MIF_SPLASH | MIF_ARC | MIF_PROXY;
 
        if(mine.cnt > 0) { mine.cnt += time; }
@@ -384,24 +389,23 @@ void W_MineLayer_Attack(Weapon thiswep, entity actor)
        actor.minelayer_mines = W_MineLayer_Count(actor);
 }
 
-float W_MineLayer_PlacedMines(entity this, float detonate)
+bool W_MineLayer_PlacedMines(entity this, bool detonate)
 {
-       entity mine;
-       float minfound = 0;
+       bool minfound = false;
 
-       for(mine = NULL; (mine = find(mine, classname, "mine")); ) if(mine.realowner == this)
+       IL_EACH(g_mines, it.realowner == this,
        {
                if(detonate)
                {
-                       if(!mine.minelayer_detonate)
+                       if(!it.minelayer_detonate)
                        {
-                               mine.minelayer_detonate = true;
-                               minfound = 1;
+                               it.minelayer_detonate = true;
+                               minfound = true;
                        }
                }
                else
-                       minfound = 1;
-       }
+                       minfound = true;
+       });
        return minfound;
 }
 
@@ -425,10 +429,8 @@ METHOD(MineLayer, wr_aim, void(entity thiswep, entity actor))
         teamdamage = 0;
         enemydamage = 0;
 
-        FOREACH_ENTITY_ENT(realowner, actor,
+        IL_EACH(g_mines, it.realowner == actor,
         {
-               if(it.classname != "mine") continue;
-
                entity mine = it;
                FOREACH_ENTITY_FLOAT(bot_attack, true,
                {
@@ -452,10 +454,8 @@ METHOD(MineLayer, wr_aim, void(entity thiswep, entity actor))
             desirabledamage = desirabledamage - teamdamage;
 
         makevectors(actor.v_angle);
-        FOREACH_ENTITY_ENT(realowner, actor,
+        IL_EACH(g_mines, it.realowner == actor,
         {
-            if(it.classname != "mine") continue;
-
             if(skill > 9) // normal players only do this for the target they are tracking
             {
                    entity mine = it;
index 29a092480110fbec3cc0978e763f63406898a078..c2e0cfc70d61d14111cf73527038dd4b83b14eb4 100644 (file)
@@ -248,6 +248,7 @@ void W_Mortar_Attack(Weapon thiswep, entity actor)
 
        gren.angles = vectoangles(gren.velocity);
        gren.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, gren);
 
        if(WEP_CVAR_PRI(mortar, type) == 0 || WEP_CVAR_PRI(mortar, type) == 2)
                CSQCProjectile(gren, true, PROJECTILE_GRENADE, true);
@@ -295,6 +296,7 @@ void W_Mortar_Attack2(Weapon thiswep, entity actor)
 
        gren.angles = vectoangles(gren.velocity);
        gren.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, gren);
 
        if(WEP_CVAR_SEC(mortar, type) == 0 || WEP_CVAR_SEC(mortar, type) == 2)
                CSQCProjectile(gren, true, PROJECTILE_GRENADE, true);
index 1f0b0603f562c28f88b3a3199e31ff55684d707c..401e4e2059d41d553ccaf3b17fe4e5f6e2977f6a 100644 (file)
@@ -275,6 +275,7 @@ void W_Porto_Attack(entity actor, float type)
 
        gren.angles = vectoangles(gren.velocity);
        gren.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, gren);
 
        gren.portal_id = time;
        actor.porto_current = gren;
index 5741c64ba8cd523aece86aae6bdb6aa80b75e600..42487b5a3cb423082c5cdfe4c8e3bdc9dbafb256 100644 (file)
@@ -294,7 +294,8 @@ void W_Seeker_Fire_Missile(Weapon thiswep, entity actor, vector f_diff, entity m
        setorigin(missile, w_shotorg);
        setsize(missile, '-4 -4 -4', '4 4 4');
        set_movetype(missile, MOVETYPE_FLYMISSILE);
-       missile.flags       = FL_PROJECTILE;
+       missile.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, missile);
        missile.missile_flags = MIF_SPLASH | MIF_GUIDED_TAG;
 
        W_SetupProjVelocity_UP_PRE(missile, seeker, missile_);
@@ -370,7 +371,8 @@ void W_Seeker_Fire_Flac(Weapon thiswep, entity actor)
        set_movetype(missile, MOVETYPE_FLY);
        missile.projectiledeathtype = WEP_SEEKER.m_id;
        missile.projectiledeathtype = WEP_SEEKER.m_id | HITTYPE_SECONDARY;
-       missile.flags                           = FL_PROJECTILE;
+       missile.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, missile);
        missile.missile_flags       = MIF_SPLASH;
 
        // csqc projectiles
@@ -589,7 +591,8 @@ void W_Seeker_Fire_Tag(Weapon thiswep, entity actor)
        setorigin(missile, w_shotorg);
        setsize(missile, '-2 -2 -2', '2 2 2');
 
-       missile.flags       = FL_PROJECTILE;
+       missile.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, missile);
        //missile.missile_flags = MIF_..?;
 
        set_movetype(missile, MOVETYPE_FLY);
index 72ea80885d9f04fc2b073aef6665ce2660befbd7..488b5af2785a654d7e76c1a83fc847dae7ce43fe 100644 (file)
@@ -287,6 +287,7 @@ void W_RocketMinsta_Attack2(entity actor)
         settouch(proj, W_RocketMinsta_Laser_Touch);
         setsize(proj, '0 0 -3', '0 0 -3');
         proj.flags = FL_PROJECTILE;
+        IL_PUSH(g_projectiles, proj);
         proj.missile_flags = MIF_SPLASH;
 
         CSQCProjectile(proj, true, PROJECTILE_ROCKETMINSTA_LASER, true);
@@ -337,6 +338,7 @@ void W_RocketMinsta_Attack3 (entity actor)
         settouch(proj, W_RocketMinsta_Laser_Touch);
         setsize(proj, '0 0 -3', '0 0 -3');
         proj.flags = FL_PROJECTILE;
+        IL_PUSH(g_projectiles, proj);
         proj.missile_flags = MIF_SPLASH;
 
         CSQCProjectile(proj, true, PROJECTILE_ROCKETMINSTA_LASER, true);
index a1c180cef831779830352ecfe6c0ad67c43409a7..109f3ad0219ccd83349b077186df1500a4580cd2 100644 (file)
@@ -449,3 +449,15 @@ STATIC_INIT(g_monsters) { g_monsters = IL_NEW(); }
 
 IntrusiveList g_waypoints;
 STATIC_INIT(g_waypoints) { g_waypoints = IL_NEW(); }
+
+IntrusiveList g_vehicles;
+STATIC_INIT(g_vehicles) { g_vehicles = IL_NEW(); }
+
+IntrusiveList g_turrets;
+STATIC_INIT(g_turrets) { g_turrets = IL_NEW(); }
+
+IntrusiveList g_mines;
+STATIC_INIT(g_mines) { g_mines = IL_NEW(); }
+
+IntrusiveList g_projectiles;
+STATIC_INIT(g_projectiles) { g_projectiles = IL_NEW(); }
index c5deb58e2beb4faf778d3f70142da82df423d909..1b2662d6e4ede1927712d46266b2afc2f9533771 100644 (file)
@@ -370,6 +370,7 @@ void FireGrapplingHook(entity actor)
        missile.reset = GrapplingHookReset;
        missile.classname = "grapplinghook";
        missile.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, missile);
 
        set_movetype(missile, ((autocvar_g_balance_grapplehook_gravity) ? MOVETYPE_TOSS : MOVETYPE_FLY));
        PROJECTILE_MAKETRIGGER(missile);
index a52470bebb6800203556e64e7f3389fc33c90646..cace20ccf46fa9c1cfa2360a5056df842a01a79e 100644 (file)
@@ -259,10 +259,11 @@ void assault_new_round(entity this)
        // Eject players from vehicles
     FOREACH_CLIENT(IS_PLAYER(it) && it.vehicle, vehicles_exit(it.vehicle, VHEF_RELEASE));
 
-    FOREACH_ENTITY_FLAGS(vehicle_flags, VHF_ISVEHICLE, LAMBDA(
+    IL_EACH(g_vehicles, true,
+    {
         vehicles_clearreturn(it);
         vehicles_spawn(it);
-    ));
+    });
 
        // up round counter
        this.winning = this.winning + 1;
index 0288347ee1f1e61bdaa47cc70b93479c04f2f02f..8e3e1075899707fdcf6248ce297f5e0394ec061d 100644 (file)
@@ -75,7 +75,7 @@ bool client_hasweapon(entity this, Weapon wpn, float andammo, bool complain)
 
                                // always allow selecting the Mine Layer if we placed mines, so that we can detonate them
                                if(wpn == WEP_MINE_LAYER)
-                                       FOREACH_ENTITY_CLASS("mine", it.owner == this,
+                                       IL_EACH(g_mines, it.owner == this,
                                        {
                                                f = 1;
                                                break; // no need to continue
index caf12a03c60ee3002aeca349a3b2ae304ef5bd58..3f372371bd3d1af12fd3e1518e434ffb9c6e5871 100644 (file)
@@ -215,10 +215,9 @@ bool weapon_prepareattack_checkammo(Weapon thiswep, entity actor, bool secondary
        // always keep the Mine Layer if we placed mines, so that we can detonate them
        if (thiswep == WEP_MINE_LAYER)
        {
-               FOREACH_ENTITY_ENT(owner, actor,
+               IL_EACH(g_mines, it.owner == actor,
                {
-                       if(it.classname != "mine") continue;
-                       if(it.owner == actor) return false;
+                       return false;
                });
        }