]> 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

26 files changed:
1  2 
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/monsters/monster/mage.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/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/g_hook.qc
qcsrc/server/mutators/mutator/gamemode_assault.qc
qcsrc/server/weapons/weaponsystem.qc

index 8e632f7c7ebd1524bd9f3a74689486c868e4a838,0118e10ba865647c9057c278e48e03a5ae2cc984..b65b558fdb1027352b45ab0bca37dc1a104b6b23
@@@ -453,7 -453,7 +453,7 @@@ spawnfunc(nexball_team
  {
        if(!g_nexball)
        {
 -              remove(this);
 +              delete(this);
                return;
        }
        this.team = this.cnt + 1;
@@@ -527,7 -527,7 +527,7 @@@ void nb_delayedinit(entity this
  
  void SpawnBall(entity this)
  {
 -      if(!g_nexball) { remove(this); return; }
 +      if(!g_nexball) { delete(this); return; }
  
  //    balls += 4; // using the remaining bits to count balls will leave more than the max edict count, so it's fine
  
@@@ -624,7 -624,7 +624,7 @@@ bool nb_Goal_Customize(entity this, ent
  
  void SpawnGoal(entity this)
  {
 -      if(!g_nexball) { remove(this); return; }
 +      if(!g_nexball) { delete(this); return; }
  
        EXACTTRIGGER_INIT;
  
@@@ -761,7 -761,7 +761,7 @@@ void W_Nexball_Touch(entity this, entit
                                GiveBall(attacker, toucher.ballcarried);
                        }
                }
 -      remove(this);
 +      delete(this);
  }
  
  void W_Nexball_Attack(entity actor, float t)
@@@ -837,6 -837,7 +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,707956d36ecc181f21c640462d08594541afb1fa..02a01eff9efee4ea36dca28b26e29a32f9b064a1
@@@ -157,7 -157,7 +157,7 @@@ void M_Mage_Attack_Spike_Explode(entit
        Send_Effect(EFFECT_EXPLOSION_SMALL, this.origin, '0 0 0', 1);
        RadiusDamage (this, this.realowner, (autocvar_g_monster_mage_attack_spike_damage), (autocvar_g_monster_mage_attack_spike_damage) * 0.5, (autocvar_g_monster_mage_attack_spike_radius), NULL, NULL, 0, DEATH_MONSTER_MAGE.m_id, directhitentity);
  
 -      remove (this);
 +      delete (this);
  }
  
  void M_Mage_Attack_Spike_Touch(entity this, entity toucher)
@@@ -235,6 -235,7 +235,7 @@@ void M_Mage_Attack_Spike(entity this, v
        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 543c99bf13bfb638471fbc508e1f91308cde5278,5eb3a2a837461c1732a066e76f394ff63222f2f4..0270119cff01c7816b5c630b058099dc81509b01
@@@ -148,7 -148,7 +148,7 @@@ void M_Spider_Attack_Web_Explode(entit
                        it.spider_slowness = time + (autocvar_g_monster_spider_attack_web_damagetime);
                });
  
 -              remove(this);
 +              delete(this);
        }
  }
  
@@@ -194,6 -194,7 +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,817606b4da42a75eddfabd506fdafe47f54e5a1e..5d2103b6aed03243a5504008cd1f4efa556a8d3a
@@@ -69,6 -69,7 +69,7 @@@ METHOD(WyvernAttack, wr_think, void(Wyv
                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;
@@@ -113,7 -114,7 +114,7 @@@ void M_Wyvern_Attack_Fireball_Explode(e
                        Fire_AddDamage(it, own, 5 * MONSTER_SKILLMOD(own), autocvar_g_monster_wyvern_attack_fireball_damagetime, this.projectiledeathtype);
        });
  
 -      remove(this);
 +      delete(this);
  }
  
  void M_Wyvern_Attack_Fireball_Touch(entity this, entity toucher)
index 38510ac00d6ed61cd6e759c2680a9bcc7082c9b3,73271176e09ee8c94b593abf4e6df3b770d0ecc9..14e2b01ac089706b6cd01f2ed8f4647f0e56692e
@@@ -163,7 -163,7 +163,7 @@@ void nade_timer_think(entity this
        this.skin = 8 - (this.owner.wait - time) / (autocvar_g_nades_nade_lifetime / 10);
        this.nextthink = time;
        if(!this.owner || wasfreed(this.owner))
 -              remove(this);
 +              delete(this);
  }
  
  void nade_burn_spawn(entity _nade)
@@@ -232,13 -232,13 +232,13 @@@ void napalm_ball_think(entity this
        if(round_handler_IsActive())
        if(!round_handler_IsRoundStarted())
        {
 -              remove(this);
 +              delete(this);
                return;
        }
  
        if(time > this.pushltime)
        {
 -              remove(this);
 +              delete(this);
                return;
        }
  
@@@ -294,6 -294,7 +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);
@@@ -306,13 -307,13 +307,13 @@@ void napalm_fountain_think(entity this
        if(round_handler_IsActive())
        if(!round_handler_IsRoundStarted())
        {
 -              remove(this);
 +              delete(this);
                return;
        }
  
        if(time >= this.ltime)
        {
 -              remove(this);
 +              delete(this);
                return;
        }
  
@@@ -379,7 -380,7 +380,7 @@@ void nade_ice_think(entity this
        if(round_handler_IsActive())
        if(!round_handler_IsRoundStarted())
        {
 -              remove(this);
 +              delete(this);
                return;
        }
  
                        Damage_DamageInfo(this.origin, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage,
                                autocvar_g_nades_nade_radius, '1 1 1' * autocvar_g_nades_nade_force, this.projectiledeathtype, 0, this);
                }
 -              remove(this);
 +              delete(this);
                return;
        }
  
@@@ -502,7 -503,7 +503,7 @@@ void nade_spawn_boom(entity this
  
        if(this.realowner.nade_spawnloc)
        {
 -              remove(this.realowner.nade_spawnloc);
 +              delete(this.realowner.nade_spawnloc);
                this.realowner.nade_spawnloc = NULL;
        }
  
@@@ -513,7 -514,7 +514,7 @@@ void nades_orb_think(entity this
  {
        if(time >= this.ltime)
        {
 -              remove(this);
 +              delete(this);
                return;
        }
  
@@@ -737,7 -738,7 +738,7 @@@ void nade_boom(entity this
                        RemoveGrapplingHook(it.realowner);
        });
  
 -      remove(this);
 +      delete(this);
  }
  
  void spawn_held_nade(entity player, entity nowner, float ntime, int ntype, string pntype);
@@@ -771,7 -772,7 +772,7 @@@ void nade_touch(entity this, entity tou
        {
                nade_pickup(toucher, this);
                sound(this, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, 0.5 *(ATTEN_LARGE + ATTEN_MAX));
 -              remove(this);
 +              delete(this);
                return;
        }
        /*float is_weapclip = 0;
                        if(it.classname == "grapplinghook")
                                RemoveGrapplingHook(it.realowner);
                });
 -              remove(this);
 +              delete(this);
                return;
        }
  
@@@ -884,7 -885,7 +885,7 @@@ void toss_nade(entity e, bool set_owner
        entity _nade = e.nade;
        e.nade = NULL;
  
 -      remove(e.fake_nade);
 +      delete(e.fake_nade);
        e.fake_nade = NULL;
  
        makevectors(e.v_angle);
        _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);
@@@ -1065,10 -1067,10 +1067,10 @@@ void nade_prime(entity this
                return; // only allow bonus nades
  
        if(this.nade)
 -              remove(this.nade);
 +              delete(this.nade);
  
        if(this.fake_nade)
 -              remove(this.fake_nade);
 +              delete(this.fake_nade);
  
        int ntype;
        string pntype = this.pokenade_type;
@@@ -1149,9 -1151,9 +1151,9 @@@ void nades_CheckThrow(entity this
  void nades_Clear(entity player)
  {
        if(player.nade)
 -              remove(player.nade);
 +              delete(player.nade);
        if(player.fake_nade)
 -              remove(player.fake_nade);
 +              delete(player.fake_nade);
  
        player.nade = player.fake_nade = NULL;
        player.nade_timer = 0;
@@@ -1349,7 -1351,7 +1351,7 @@@ MUTATOR_HOOKFUNCTION(nades, PlayerSpawn
  
                if(player.nade_spawnloc.cnt <= 0)
                {
 -                      remove(player.nade_spawnloc);
 +                      delete(player.nade_spawnloc);
                        player.nade_spawnloc = NULL;
                }
        }
index bd1386cd0a76b9cc67203d8323b39cc3884e31b0,a2fdd43a649b72f75c9b738b088595a96fb8d026..d9e68f20f2a9b79ea5b8a21f5f7258e455291479
@@@ -57,7 -57,7 +57,7 @@@ void W_RocketPropelledChainsaw_Explode(
  
        RadiusDamage (this, this.realowner, WEP_CVAR(rpc, damage), WEP_CVAR(rpc, edgedamage), WEP_CVAR(rpc, radius), NULL, NULL, WEP_CVAR(rpc, force), this.projectiledeathtype, directhitentity);
  
 -      remove (this);
 +      delete (this);
  }
  
  void W_RocketPropelledChainsaw_Explode_think(entity this)
@@@ -92,7 -92,7 +92,7 @@@ void W_RocketPropelledChainsaw_Think(en
  {
        if(this.cnt <= time)
        {
 -              remove(this);
 +              delete(this);
                return;
        }
  
@@@ -143,6 -143,7 +143,7 @@@ void W_RocketPropelledChainsaw_Attack (
        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,a543c1d88c18320ee6046e335ad14a846b1734ea..f1515d070a96fdd55dfd92321dcea1e2fbd814e9
@@@ -193,8 -193,8 +193,8 @@@ void turret_die(entity this
        {
                tur.tr_death(tur, this);
  
 -              remove(this.tur_head);
 -              remove(this);
 +              delete(this.tur_head);
 +              delete(this);
        }
        else
        {
@@@ -440,7 -440,7 +440,7 @@@ void turret_projectile_explode(entity t
  #else
        RadiusDamage (this, this.realowner, this.owner.shot_dmg, 0, this.owner.shot_radius, this, NULL, this.owner.shot_force, this.totalfrags, NULL);
  #endif
 -      remove(this);
 +      delete(this);
  }
  
  void turret_projectile_touch(entity this, entity toucher)
@@@ -476,7 -476,8 +476,8 @@@ entity turret_projectile(entity actor, 
        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 +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 +1250,7 @@@ bool turret_initialize(entity this, 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");
        this.tur_head.owner                     = this;
        this.tur_head.takedamage        = DAMAGE_NO;
        this.tur_head.solid                     = SOLID_NOT;
 -      this.tur_head.move_movetype             = this.move_movetype;
 +      set_movetype(this.tur_head, this.move_movetype);
  
        if(!this.tur_defend)
        if(this.target != "")
index 50f468a7452bb530739ae4a6e8c9d9def938f0ef,32f645f27c01bd6d06256325b52ccf36b2947c48..ff2ce88c7d8b8cd19553707e4c3d56333276bac8
@@@ -100,7 -100,7 +100,7 @@@ void walker_setnoanim(entity this
  void walker_rocket_explode(entity this)
  {
      RadiusDamage (this, this.owner, (autocvar_g_turrets_unit_walker_rocket_damage), 0, (autocvar_g_turrets_unit_walker_rocket_radius), this, NULL, (autocvar_g_turrets_unit_walker_rocket_force), DEATH_TURRET_WALK_ROCKET.m_id, NULL);
 -    remove (this);
 +    delete (this);
  }
  
  void walker_rocket_touch(entity this, entity toucher)
@@@ -259,7 -259,8 +259,8 @@@ void walker_fire_rocket(entity this, ve
      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;
@@@ -344,7 -345,7 +345,7 @@@ void walker_move_path(entity this
  #endif
  }
  
 -spawnfunc(turret_walker) { if(!turret_initialize(this, TUR_WALKER)) remove(this); }
 +spawnfunc(turret_walker) { if(!turret_initialize(this, TUR_WALKER)) delete(this); }
  
  METHOD(WalkerTurret, tr_think, void(WalkerTurret thistur, entity it))
  {
@@@ -652,7 -653,7 +653,7 @@@ void walker_draw(entity this
          METHOD(WalkerTurret, tr_setup, void(WalkerTurret this, entity it))
          {
              it.gravity                = 1;
 -            it.move_movetype  = MOVETYPE_BOUNCE;
 +            set_movetype(it, MOVETYPE_BOUNCE);
              it.move_time              = time;
              it.draw                   = walker_draw;
          }
index e529d4ad703680954d18b11acd74e480e7696065,19928cb0893b9c55ce86faf3b498b3fd8f1ee732..9f02cf21bcecfd5992ca151f81613d5ef6006416
@@@ -214,7 -214,7 +214,7 @@@ void vehicles_projectile_explode(entit
        this.event_damage = func_null;
        RadiusDamage (this, this.realowner, this.shot_dmg, 0, this.shot_radius, this, NULL, this.shot_force, this.totalfrags, toucher);
  
 -      remove (this);
 +      delete (this);
  }
  
  void vehicles_projectile_explode_think(entity this)
@@@ -247,7 -247,8 +247,8 @@@ entity vehicles_projectile(entity this
        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;
                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);
@@@ -285,7 -286,7 +286,7 @@@ void vehicles_gib_explode(entity this
        sound (this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
        Send_Effect(EFFECT_EXPLOSION_SMALL, randomvec() * 80 + (this.origin + '0 0 100'), '0 0 0', 1);
        Send_Effect(EFFECT_EXPLOSION_SMALL, this.wp00.origin + '0 0 64', '0 0 0', 1);
 -      remove(this);
 +      delete(this);
  }
  
  void vehicles_gib_touch(entity this, entity toucher)
@@@ -297,7 -298,7 +298,7 @@@ void vehicles_gib_think(entity this
  {
        this.alpha -= 0.1;
        if(this.cnt >= time)
 -              remove(this);
 +              delete(this);
        else
                this.nextthink = time + 0.1;
  }
@@@ -457,7 -458,7 +458,7 @@@ void vehicles_return(entity this
        if(this.waypointsprite_attached)
                WaypointSprite_Kill(this.waypointsprite_attached);
  
 -      remove(this);
 +      delete(this);
  }
  
  void vehicles_showwp_goaway(entity this)
        if(this.waypointsprite_attached)
                WaypointSprite_Kill(this.waypointsprite_attached);
  
 -      remove(this);
 +      delete(this);
  }
  
  void vehicles_showwp(entity this)
@@@ -1115,7 -1116,10 +1116,10 @@@ bool vehicle_initialize(entity this, Ve
                return false;
  
        if(!this.tur_head)
+       {
                info.vr_precache(info);
+               IL_PUSH(g_vehicles, this);
+       }
  
        if(this.targetname && this.targetname != "")
        {
index 04c985c31f4dbb62910d724a58003b157e919a2d,b0f5eb23a1553955845dc851e638b77c6c886115..6b33f8c1a3b7837cba0f340206225ac41f811bf9
@@@ -430,9 -430,8 +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))
                        {
@@@ -600,8 -599,8 +599,8 @@@ bool raptor_impulse(entity this, int _i
  
  spawnfunc(vehicle_raptor)
  {
 -      if(!autocvar_g_vehicle_raptor) { remove(this); return; }
 -      if(!vehicle_initialize(this, VEH_RAPTOR, false)) { remove(this); return; }
 +      if(!autocvar_g_vehicle_raptor) { delete(this); return; }
 +      if(!vehicle_initialize(this, VEH_RAPTOR, false)) { delete(this); return; }
  }
  
  METHOD(Raptor, vr_impact, void(Raptor thisveh, entity instance))
index 42818169ba324eab3688f28b652428473d39a24f,b40ffc921ec3a24db9cde3ab6beffafa73af32a2..0c3765a13955fc6b1ce56e03b89f9345fed32da3
@@@ -75,7 -75,7 +75,7 @@@ void W_Blaster_Touch(entity this, entit
                toucher
        );
  
 -      remove(this);
 +      delete(this);
  }
  
  void W_Blaster_Think(entity this)
@@@ -137,6 -137,7 +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,04b0026b5d75614858c998310f73bf7a9ef992d6..bb782643a67bb6ace6a5fd5196c93e2786cf8ac8
@@@ -114,7 -114,7 +114,7 @@@ void W_Crylink_Dequeue(entity e
  void W_Crylink_Reset(entity this)
  {
        W_Crylink_Dequeue(this);
 -      remove(this);
 +      delete(this);
  }
  
  // force projectile to explode
@@@ -138,7 -138,7 +138,7 @@@ void W_Crylink_LinkExplode(entity e, en
        W_Crylink_LinkExplode(e.queuenext, e2, directhitentity);
  
        e.classname = "spike_oktoremove";
 -      remove(e);
 +      delete(e);
  }
  
  // adjust towards center
@@@ -268,7 -268,7 +268,7 @@@ void W_Crylink_LinkJoinEffect_Think(ent
                        }
                }
        }
 -      remove(this);
 +      delete(this);
  }
  
  float W_Crylink_Touch_WouldHitFriendly(entity projectile, float rad)
@@@ -320,14 -320,14 +320,14 @@@ void W_Crylink_Touch(entity this, entit
                        this.realowner.crylink_lastgroup = NULL;
                W_Crylink_LinkExplode(this.queuenext, this, toucher);
                this.classname = "spike_oktoremove";
 -              remove(this);
 +              delete(this);
                return;
        }
        else if(finalhit)
        {
                // just unlink
                W_Crylink_Dequeue(this);
 -              remove(this);
 +              delete(this);
                return;
        }
        this.cnt = this.cnt - 1;
  void W_Crylink_Fadethink(entity this)
  {
        W_Crylink_Dequeue(this);
 -      remove(this);
 +      delete(this);
  }
  
  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 +555,7 @@@ void W_Crylink_Attack2(Weapon thiswep, 
                //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,72a64dca7d968b588155c20c4a825091a7f22e59..870ced3d9c1c713d0ea2f0b2e2882516b3f670d1
@@@ -120,7 -120,7 +120,7 @@@ void W_Devastator_Explode(entity this, 
                        PS(this.realowner).m_switchweapon = w_getbestweapon(this.realowner);
                }
        }
 -      remove(this);
 +      delete(this);
  }
  
  void W_Devastator_Explode_think(entity this)
@@@ -206,7 -206,7 +206,7 @@@ void W_Devastator_DoRemoteExplode(entit
                        PS(this.realowner).m_switchweapon = w_getbestweapon(this.realowner);
                }
        }
 -      remove(this);
 +      delete(this);
  }
  
  void W_Devastator_RemoteExplode(entity this, .entity weaponentity)
@@@ -390,6 -390,7 +390,7 @@@ void W_Devastator_Attack(Weapon thiswep
        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,89524b154e3b3d49374773250120c791885a890f..5f8208a7ff6419ee9b82819f0df179030bee9afa
@@@ -142,7 -142,7 +142,7 @@@ void W_Electro_ExplodeCombo(entity this
                NULL
        );
  
 -      remove(this);
 +      delete(this);
  }
  
  void W_Electro_Explode(entity this, entity directhitentity)
                );
        }
  
 -      remove(this);
 +      delete(this);
  }
  
  void W_Electro_Explode_use(entity this, entity actor, entity trigger)
@@@ -298,6 -298,7 +298,7 @@@ void W_Electro_Attack_Bolt(Weapon thisw
        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);
@@@ -338,7 -339,7 +339,7 @@@ void W_Electro_Orb_Stick(entity this, e
        newproj.use = this.use;
        newproj.flags = this.flags;
  
 -      remove(this);
 +      delete(this);
  
        if(to)
                SetMovetypeFollow(this, to);
@@@ -443,6 -444,7 +444,7 @@@ void W_Electro_Attack_Orb(Weapon thiswe
        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,bfcd1c6427a39a6cc6426f3e3274a8c323e6612d..a523354a021ee6f6e2e4d6cc80e28b16dd8c27a3
@@@ -109,7 -109,7 +109,7 @@@ void W_Fireball_Explode(entity this, en
                }
        }
  
 -      remove(this);
 +      delete(this);
  }
  
  void W_Fireball_Explode_think(entity this)
@@@ -224,6 -224,7 +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);
@@@ -273,7 -274,7 +274,7 @@@ void W_Fireball_Firemine_Think(entity t
  {
        if(time > this.pushltime)
        {
 -              remove(this);
 +              delete(this);
                return;
        }
  
@@@ -301,7 -302,7 +302,7 @@@ void W_Fireball_Firemine_Touch(entity t
        if(toucher.takedamage == DAMAGE_AIM)
        if(Fire_AddDamage(toucher, this.realowner, WEP_CVAR_SEC(fireball, damage), WEP_CVAR_SEC(fireball, damagetime), this.projectiledeathtype) >= 0)
        {
 -              remove(this);
 +              delete(this);
                return;
        }
        this.projectiledeathtype |= HITTYPE_BOUNCE;
@@@ -354,6 -355,7 +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,667667f421086cfeb1761dc29f7626425f481a69..7d45dc8b824d0b5d31145589abb69b7acfcbfed3
@@@ -68,7 -68,7 +68,7 @@@ void W_Hagar_Explode(entity this, entit
        this.event_damage = func_null;
        RadiusDamage(this, this.realowner, WEP_CVAR_PRI(hagar, damage), WEP_CVAR_PRI(hagar, edgedamage), WEP_CVAR_PRI(hagar, radius), NULL, NULL, WEP_CVAR_PRI(hagar, force), this.projectiledeathtype, directhitentity);
  
 -      remove(this);
 +      delete(this);
  }
  
  void W_Hagar_Explode_use(entity this, entity actor, entity trigger)
@@@ -81,7 -81,7 +81,7 @@@ void W_Hagar_Explode2(entity this, enti
        this.event_damage = func_null;
        RadiusDamage(this, this.realowner, WEP_CVAR_SEC(hagar, damage), WEP_CVAR_SEC(hagar, edgedamage), WEP_CVAR_SEC(hagar, radius), NULL, NULL, WEP_CVAR_SEC(hagar, force), this.projectiledeathtype, directhitentity);
  
 -      remove(this);
 +      delete(this);
  }
  
  void W_Hagar_Explode2_use(entity this, entity actor, entity trigger)
@@@ -169,6 -169,7 +169,7 @@@ void W_Hagar_Attack(Weapon thiswep, ent
  
        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 +213,7 @@@ void W_Hagar_Attack2(Weapon thiswep, en
  
        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 +290,7 @@@ void W_Hagar_Attack2_Load_Release(entit
  
                missile.angles = vectoangles(missile.velocity);
                missile.flags = FL_PROJECTILE;
+               IL_PUSH(g_projectiles, missile);
  
                CSQCProjectile(missile, true, PROJECTILE_HAGAR, true);
  
index 1ecc3f0ffe5431921f760ad472e343b2a173a497,9706c586b695f5b92df220847adcc816747bbb8f..64c87c8a0639eccdcc79249b710d3723350c2654
@@@ -66,7 -66,7 +66,7 @@@ void W_HLAC_Touch(entity this, entity t
  
        RadiusDamage(this, this.realowner, WEP_CVAR_BOTH(hlac, isprimary, damage), WEP_CVAR_BOTH(hlac, isprimary, edgedamage), WEP_CVAR_BOTH(hlac, isprimary, radius), NULL, NULL, WEP_CVAR_BOTH(hlac, isprimary, force), this.projectiledeathtype, toucher);
  
 -      remove(this);
 +      delete(this);
  }
  
  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 +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,fec774e14337af3fd68ae5145c1d9ec050adec35..e9200e762656d2d01d948026f6fec7feb85e4bfb
@@@ -96,7 -96,7 +96,7 @@@ void W_Hook_ExplodeThink(entity this
        if(dt < this.dmg_duration)
                this.nextthink = time + 0.05; // soon
        else
 -              remove(this);
 +              delete(this);
  }
  
  void W_Hook_Explode2(entity this)
@@@ -179,6 -179,7 +179,7 @@@ void W_Hook_Attack2(Weapon thiswep, ent
  
        gren.angles = '0 0 0';
        gren.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, gren);
  
        CSQCProjectile(gren, true, PROJECTILE_HOOKBOMB, true);
  
index b4b38031fc80deda3690cbac489c2dc21e13a94f,70925b8352f8527f1208b8a11747fff9e19940fe..e5ba64f2464068102c2b5f568087c739eca3836c
@@@ -70,6 -70,7 +70,7 @@@ void W_MineLayer_Stick(entity this, ent
        // 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;
        newmine.nextthink = time;
        newmine.cnt = this.cnt;
        newmine.flags = this.flags;
+       IL_PUSH(g_projectiles, newmine);
  
 -      remove(this);
 +      delete(this);
  
        if(to)
                SetMovetypeFollow(newmine, to);
@@@ -135,7 -137,7 +137,7 @@@ void W_MineLayer_Explode(entity this, e
                }
        }
        this.realowner.minelayer_mines -= 1;
 -      remove(this);
 +      delete(this);
  }
  
  void W_MineLayer_Explode_think(entity this)
@@@ -166,7 -168,7 +168,7 @@@ void W_MineLayer_DoRemoteExplode(entit
                }
        }
        this.realowner.minelayer_mines -= 1;
 -      remove(this);
 +      delete(this);
  }
  
  void W_MineLayer_RemoteExplode(entity this)
@@@ -203,9 -205,10 +205,10 @@@ void W_MineLayer_ProximityExplode(entit
  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 +338,7 @@@ void W_MineLayer_Attack(Weapon thiswep
        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);
        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; }
        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 +429,8 @@@ METHOD(MineLayer, wr_aim, void(entity t
          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,
                {
              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,94eabce410d12b0642e28a2f6fe6a4dee46240a7..c2e0cfc70d61d14111cf73527038dd4b83b14eb4
@@@ -81,7 -81,7 +81,7 @@@ void W_Mortar_Grenade_Explode(entity th
  
        RadiusDamage(this, this.realowner, WEP_CVAR_PRI(mortar, damage), WEP_CVAR_PRI(mortar, edgedamage), WEP_CVAR_PRI(mortar, radius), NULL, NULL, WEP_CVAR_PRI(mortar, force), this.projectiledeathtype, directhitentity);
  
 -      remove(this);
 +      delete(this);
  }
  
  void W_Mortar_Grenade_Explode_use(entity this, entity actor, entity trigger)
@@@ -106,7 -106,7 +106,7 @@@ void W_Mortar_Grenade_Explode2(entity t
  
        RadiusDamage(this, this.realowner, WEP_CVAR_SEC(mortar, damage), WEP_CVAR_SEC(mortar, edgedamage), WEP_CVAR_SEC(mortar, radius), NULL, NULL, WEP_CVAR_SEC(mortar, force), this.projectiledeathtype, directhitentity);
  
 -      remove(this);
 +      delete(this);
  }
  
  void W_Mortar_Grenade_Explode2_use(entity this, entity actor, entity trigger)
@@@ -248,6 -248,7 +248,7 @@@ void W_Mortar_Attack(Weapon thiswep, en
  
        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 +296,7 @@@ void W_Mortar_Attack2(Weapon thiswep, e
  
        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,2ab7cd42deb460e2dda3253f5ba963e670e57b75..401e4e2059d41d553ccaf3b17fe4e5f6e2977f6a
@@@ -62,7 -62,7 +62,7 @@@ void W_Porto_Success(entity this
        }
  
        this.realowner.porto_current = NULL;
 -      remove(this);
 +      delete(this);
  }
  
  string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vector velo);
@@@ -98,7 -98,7 +98,7 @@@ void W_Porto_Fail(entity this, float fa
                        }
                }
        }
 -      remove(this);
 +      delete(this);
  }
  
  void W_Porto_Remove(entity p)
@@@ -113,7 -113,7 +113,7 @@@ void W_Porto_Think(entity this
  {
        trace_plane_normal = '0 0 0';
        if(this.realowner.playerid != this.playerid)
 -              remove(this);
 +              delete(this);
        else
                W_Porto_Fail(this, 0);
  }
@@@ -143,7 -143,7 +143,7 @@@ void W_Porto_Touch(entity this, entity 
        if(this.realowner.playerid != this.playerid)
        {
                sound(this, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM);
 -              remove(this);
 +              delete(this);
        }
        else if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK || trace_dphitcontents & DPCONTENTS_PLAYERCLIP)
        {
@@@ -275,6 -275,7 +275,7 @@@ void W_Porto_Attack(entity actor, floa
  
        gren.angles = vectoangles(gren.velocity);
        gren.flags = FL_PROJECTILE;
+       IL_PUSH(g_projectiles, gren);
  
        gren.portal_id = time;
        actor.porto_current = gren;
index 5741c64ba8cd523aece86aae6bdb6aa80b75e600,34d8da46e82b00a2466c6e7b22090bd2f9efdc9e..42487b5a3cb423082c5cdfe4c8e3bdc9dbafb256
@@@ -99,7 -99,7 +99,7 @@@ void W_Seeker_Missile_Explode(entity th
        this.event_damage = func_null;
        RadiusDamage(this, this.realowner, WEP_CVAR(seeker, missile_damage), WEP_CVAR(seeker, missile_edgedamage), WEP_CVAR(seeker, missile_radius), NULL, NULL, WEP_CVAR(seeker, missile_force), this.projectiledeathtype, directhitentity);
  
 -      remove(this);
 +      delete(this);
  }
  
  void W_Seeker_Missile_Explode_think(entity this)
@@@ -294,7 -294,8 +294,8 @@@ void W_Seeker_Fire_Missile(Weapon thisw
        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_);
@@@ -315,7 -316,7 +316,7 @@@ void W_Seeker_Flac_Explode(entity this
  
        RadiusDamage(this, this.realowner, WEP_CVAR(seeker, flac_damage), WEP_CVAR(seeker, flac_edgedamage), WEP_CVAR(seeker, flac_radius), NULL, NULL, WEP_CVAR(seeker, flac_force), this.projectiledeathtype, directhitentity);
  
 -      remove(this);
 +      delete(this);
  }
  
  void W_Seeker_Flac_Touch(entity this, entity toucher)
@@@ -370,7 -371,8 +371,8 @@@ void W_Seeker_Fire_Flac(Weapon thiswep
        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
@@@ -431,7 -433,7 +433,7 @@@ void W_Seeker_Vollycontroller_Think(ent
        Weapon thiswep = WEP_SEEKER;
        if((!(this.realowner.items & IT_UNLIMITED_AMMO) && this.realowner.(thiswep.ammo_field) < WEP_CVAR(seeker, missile_ammo)) || (this.cnt <= -1) || (IS_DEAD(this.realowner)) || (PS(this.realowner).m_switchweapon != WEP_SEEKER))
        {
 -              remove(this);
 +              delete(this);
                return;
        }
  
@@@ -472,7 -474,7 +474,7 @@@ void W_Seeker_Tracker_Think(entity this
                if(this)
                {
                        WaypointSprite_Kill(this.tag_target.wps_tag_tracker);
 -                      remove(this);
 +                      delete(this);
                }
                return;
        }
@@@ -490,7 -492,7 +492,7 @@@ void W_Seeker_Tag_Explode(entity this
        //    return;
        Damage_DamageInfo(this.origin, 0, 0, 0, this.velocity, WEP_SEEKER.m_id | HITTYPE_BOUNCE, 0, this);
  
 -      remove(this);
 +      delete(this);
  }
  
  void W_Seeker_Tag_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
@@@ -560,7 -562,7 +562,7 @@@ void W_Seeker_Tag_Touch(entity this, en
                }
        }
  
 -      remove(this);
 +      delete(this);
        return;
  }
  
@@@ -589,7 -591,8 +591,8 @@@ void W_Seeker_Fire_Tag(Weapon thiswep, 
        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,b2b278c2a52d55c4fb4a09c10a90ba172e0555e6..488b5af2785a654d7e76c1a83fc847dae7ce43fe
@@@ -158,7 -158,7 +158,7 @@@ NET_HANDLE(TE_CSQC_VAPORBEAMPARTICLE, b
                WarpZone_TrailParticles(NULL, particleeffectnum(((this.cnt) ? EFFECT_VAPORIZER_HIT(this.team) : EFFECT_VAPORIZER(this.team))), this.vorg1, this.vorg2);
                this.draw = func_null;
                this.drawmask = MASK_NORMAL;
 -              remove(this);
 +              delete(this);
        }
  
        return true;
@@@ -177,7 -177,7 +177,7 @@@ void W_RocketMinsta_Explosion(entity ac
        dmgent.owner = dmgent.realowner = actor;
        setorigin(dmgent, loc);
        RadiusDamage (dmgent, actor, autocvar_g_rm_damage, autocvar_g_rm_edgedamage, autocvar_g_rm_radius, NULL, NULL, autocvar_g_rm_force, WEP_DEVASTATOR.m_id | HITTYPE_SPLASH, other);
 -      remove(dmgent);
 +      delete(dmgent);
  }
  
  void W_Vaporizer_Attack(Weapon thiswep, entity actor)
@@@ -226,7 -226,7 +226,7 @@@ void W_RocketMinsta_Laser_Explode (enti
        this.event_damage = func_null;
        this.takedamage = DAMAGE_NO;
        RadiusDamage (this, this.realowner, this.rm_damage, this.rm_edmg, autocvar_g_rm_laser_radius, NULL, NULL, this.rm_force, this.projectiledeathtype, other);
 -      remove(this);
 +      delete(this);
  }
  
  void W_RocketMinsta_Laser_Explode_use(entity this, entity actor, entity trigger)
@@@ -239,7 -239,7 +239,7 @@@ void W_RocketMinsta_Laser_Touch(entity 
        PROJECTILE_TOUCH(this, toucher);
        //W_RocketMinsta_Laser_Explode ();
        RadiusDamage(this, this.realowner, this.rm_damage, this.rm_edmg, autocvar_g_rm_laser_radius, NULL, NULL, this.rm_force, this.projectiledeathtype, toucher);
 -      remove(this);
 +      delete(this);
  }
  
  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 +338,7 @@@ void W_RocketMinsta_Attack3 (entity act
          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);
diff --combined qcsrc/server/g_hook.qc
index c5deb58e2beb4faf778d3f70142da82df423d909,a198e92948292419eccffc7ed8acfaeff1e6609a..1b2662d6e4ede1927712d46266b2afc2f9533771
@@@ -74,7 -74,7 +74,7 @@@ void RemoveGrapplingHook(entity pl
  {
        if(pl.hook == NULL)
                return;
 -      remove(pl.hook);
 +      delete(pl.hook);
        pl.hook = NULL;
        if(pl.move_movetype == MOVETYPE_FLY)
                set_movetype(pl, MOVETYPE_WALK);
@@@ -87,7 -87,7 +87,7 @@@ void GrapplingHookReset(entity this
        if(this.realowner.hook == this)
                RemoveGrapplingHook(this.owner);
        else // in any case:
 -              remove(this);
 +              delete(this);
  }
  
  void GrapplingHookThink(entity this);
@@@ -370,6 -370,7 +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,3fa22343d28fdf4c6023b600050d74bcd612eb9d..cace20ccf46fa9c1cfa2360a5056df842a01a79e
@@@ -259,10 -259,11 +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;
@@@ -332,7 -333,7 +333,7 @@@ int WinningCondition_Assault(
  // spawnfuncs
  spawnfunc(info_player_attacker)
  {
 -      if (!g_assault) { remove(this); return; }
 +      if (!g_assault) { delete(this); return; }
  
        this.team = NUM_TEAM_1; // red, gets swapped every round
        spawnfunc_info_player_deathmatch(this);
  
  spawnfunc(info_player_defender)
  {
 -      if (!g_assault) { remove(this); return; }
 +      if (!g_assault) { delete(this); return; }
  
        this.team = NUM_TEAM_2; // blue, gets swapped every round
        spawnfunc_info_player_deathmatch(this);
  
  spawnfunc(target_objective)
  {
 -      if (!g_assault) { remove(this); return; }
 +      if (!g_assault) { delete(this); return; }
  
        this.classname = "target_objective";
        this.use = assault_objective_use;
  
  spawnfunc(target_objective_decrease)
  {
 -      if (!g_assault) { remove(this); return; }
 +      if (!g_assault) { delete(this); return; }
  
        this.classname = "target_objective_decrease";
  
  spawnfunc(func_breakable);
  spawnfunc(func_assault_destructible)
  {
 -      if (!g_assault) { remove(this); return; }
 +      if (!g_assault) { delete(this); return; }
  
        this.spawnflags = 3;
        this.classname = "func_assault_destructible";
  
  spawnfunc(func_assault_wall)
  {
 -      if (!g_assault) { remove(this); return; }
 +      if (!g_assault) { delete(this); return; }
  
        this.classname = "func_assault_wall";
        this.mdl = this.model;
  
  spawnfunc(target_assault_roundend)
  {
 -      if (!g_assault) { remove(this); return; }
 +      if (!g_assault) { delete(this); return; }
  
        this.winning = 0; // round not yet won by attackers
        this.classname = "target_assault_roundend";
  
  spawnfunc(target_assault_roundstart)
  {
 -      if (!g_assault) { remove(this); return; }
 +      if (!g_assault) { delete(this); return; }
  
        assault_attacker_team = NUM_TEAM_1;
        this.classname = "target_assault_roundstart";
index caf12a03c60ee3002aeca349a3b2ae304ef5bd58,71622545c6b99bcd7f137b880cdab86f18da0efc..3f372371bd3d1af12fd3e1518e434ffb9c6e5871
@@@ -54,7 -54,7 +54,7 @@@ vector CL_Weapon_GetShotOrg(int wpn
        CL_WeaponEntity_SetModel(e, wi.mdl, false);
        vector ret = e.movedir;
        CL_WeaponEntity_SetModel(e, "", false);
 -      remove(e);
 +      delete(e);
        return ret;
  }
  
@@@ -69,8 -69,8 +69,8 @@@ void CL_Weaponentity_Think(entity this
        if (this.owner.(weaponentity) != this)
        {
                // owner has new gun; remove old one
 -              if (this.weaponchild) remove(this.weaponchild);
 -              remove(this);
 +              if (this.weaponchild) delete(this.weaponchild);
 +              delete(this);
                return;
        }
        if (IS_DEAD(this.owner))
@@@ -110,7 -110,7 +110,7 @@@ void CL_ExteriorWeaponentity_Think(enti
        this.nextthink = time;
        if (this.owner.exteriorweaponentity != this)
        {
 -              remove(this);
 +              delete(this);
                return;
        }
        if (IS_DEAD(this.owner))
@@@ -215,10 -215,9 +215,9 @@@ bool weapon_prepareattack_checkammo(Wea
        // 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;
                });
        }