entity WarpZone_Find(vector mi, vector ma)
{
// if we are near any warpzone planes - MOVE AWAY (work around nearclip)
- entity e;
if(!warpzone_warpzones_exist)
return NULL;
- for(e = NULL; (e = find(e, classname, "trigger_warpzone")); )
- if(WarpZoneLib_BoxTouchesBrush(mi, ma, e, NULL))
- return e;
+ IL_EACH(g_warpzones, WarpZoneLib_BoxTouchesBrush(mi, ma, it, NULL),
+ {
+ return it;
+ });
return NULL;
}
void WarpZone_MakeAllSolid()
{
- entity e;
if(!warpzone_warpzones_exist)
return;
- for(e = NULL; (e = find(e, classname, "trigger_warpzone")); )
- e.solid = SOLID_BSP;
+ IL_EACH(g_warpzones, true,
+ {
+ it.solid = SOLID_BSP;
+ });
}
void WarpZone_MakeAllOther()
{
- entity e;
if(!warpzone_warpzones_exist)
return;
- for(e = NULL; (e = find(e, classname, "trigger_warpzone")); )
- e.solid = SOLID_TRIGGER;
+ IL_EACH(g_warpzones, true,
+ {
+ it.solid = SOLID_TRIGGER;
+ });
}
void WarpZone_Trace_InitTransform()
// uncomment this if your mod uses the roll angle in fixangle
// #define KEEP_ROLL
+IntrusiveList g_warpzones;
+STATIC_INIT(g_warpzones) { g_warpzones = IL_NEW(); }
+
float warpzone_warpzones_exist;
float warpzone_cameras_exist;
this.enemy = NULL;
}
-entity warpzone_first; .entity warpzone_next;
void WarpZone_InitStep_FindTarget(entity this)
{
float i;
BITSET_ASSIGN(this.effects, EF_NODEPTHTEST);
this.warpzone_next = warpzone_first;
warpzone_first = this;
+
+ IL_PUSH(g_warpzones, this);
}
spawnfunc(func_camera)
{
void WarpZone_PostInitialize_Callback()
{
// create waypoint links for warpzones
- entity e;
- for(e = NULL; (e = find(e, classname, "trigger_warpzone")); )
+ for(entity e = warpzone_first; e; e = e.warpzone_next)
+ //for(entity e = NULL; (e = find(e, classname, "trigger_warpzone")); )
{
vector src, dst;
src = (e.absmin + e.absmax) * 0.5;