- if(self.warpzone_fadestart)
- if(vdist(org - self.origin - 0.5 * (self.mins + self.maxs), >, self.warpzone_fadeend + 400))
+ if(this.warpzone_fadestart)
+ if(vdist(org - this.origin - 0.5 * (this.mins + this.maxs), >, this.warpzone_fadeend + 400))
return org;
// don't transform if zone faded out (plus 400qu safety margin for typical speeds and latencies)
// unneeded on client, on server this helps a lot
vf = v_forward;
vr = v_right;
vu = v_up;
return org;
// don't transform if zone faded out (plus 400qu safety margin for typical speeds and latencies)
// unneeded on client, on server this helps a lot
vf = v_forward;
vr = v_right;
vu = v_up;
- org = WarpZone_TransformOrigin(self, org);
- vf = WarpZone_TransformVelocity(self, vf);
- vr = WarpZone_TransformVelocity(self, vr);
- vu = WarpZone_TransformVelocity(self, vu);
+ org = WarpZone_TransformOrigin(this, org);
+ vf = WarpZone_TransformVelocity(this, vf);
+ vr = WarpZone_TransformVelocity(this, vr);
+ vu = WarpZone_TransformVelocity(this, vu);
- traceline(self.warpzone_targetorigin, org, MOVE_NOMONSTERS, world);
+ traceline(this.warpzone_targetorigin, org, MOVE_NOMONSTERS, NULL);
e.warpzone_targetangles = other_ang;
fixedmakevectors(my_ang); e.warpzone_forward = v_forward;
fixedmakevectors(other_ang); e.warpzone_targetforward = v_forward;
e.warpzone_targetangles = other_ang;
fixedmakevectors(my_ang); e.warpzone_forward = v_forward;
fixedmakevectors(other_ang); e.warpzone_targetforward = v_forward;
- if(self.warpzone_fadestart)
- if(vdist(org - self.origin - 0.5 * (self.mins + self.maxs), >, self.warpzone_fadeend + 400))
+ if(this.warpzone_fadestart)
+ if(vdist(org - this.origin - 0.5 * (this.mins + this.maxs), >, this.warpzone_fadeend + 400))
return org;
// don't transform if zone faded out (plus 400qu safety margin for typical speeds and latencies)
// unneeded on client, on server this helps a lot
return org;
// don't transform if zone faded out (plus 400qu safety margin for typical speeds and latencies)
// unneeded on client, on server this helps a lot
- trace_endpos = self.warpzone_origin;
- makevectors(self.warpzone_angles);
- return self.warpzone_origin;
+ trace_endpos = this.warpzone_origin;
+ makevectors(this.warpzone_angles);
+ return this.warpzone_origin;
}
void WarpZone_Camera_SetUp(entity e, vector my_org, vector my_ang) // we assume that e.oldorigin and e.avelocity point to view origin and direction
{
e.warpzone_origin = my_org;
e.warpzone_angles = my_ang;
}
void WarpZone_Camera_SetUp(entity e, vector my_org, vector my_ang) // we assume that e.oldorigin and e.avelocity point to view origin and direction
{
e.warpzone_origin = my_org;
e.warpzone_angles = my_ang;
entity WarpZone_Find(vector mi, vector ma)
{
// if we are near any warpzone planes - MOVE AWAY (work around nearclip)
entity WarpZone_Find(vector mi, vector ma)
{
// if we are near any warpzone planes - MOVE AWAY (work around nearclip)
- return world;
- for(e = world; (e = find(e, classname, "trigger_warpzone")); )
- if(WarpZoneLib_BoxTouchesBrush(mi, ma, e, world))
- return e;
- return world;
+ return NULL;
+ IL_EACH(g_warpzones, WarpZoneLib_BoxTouchesBrush(mi, ma, it, NULL),
+ {
+ return it;
+ });
+ return NULL;
- for(e = world; (e = find(e, classname, "trigger_warpzone")); )
- e.solid = SOLID_TRIGGER;
+ IL_EACH(g_warpzones, true,
+ {
+ it.solid = SOLID_TRIGGER;
+ });
break;
}
tracebox(org, mi, ma, end, nomonsters_adjusted, WarpZone_trace_forent);
break;
}
tracebox(org, mi, ma, end, nomonsters_adjusted, WarpZone_trace_forent);
void WarpZone_TraceBox(vector org, vector mi, vector ma, vector end, float nomonsters, entity forent)
{
void WarpZone_TraceBox(vector org, vector mi, vector ma, vector end, float nomonsters, entity forent)
{
- WarpZone_TraceBox_ThroughZone(org, mi, ma, end, nomonsters, forent, world, WarpZone_trace_callback_t_null);
+ WarpZone_TraceBox_ThroughZone(org, mi, ma, end, nomonsters, forent, NULL, WarpZone_trace_callback_t_null);
}
void WarpZone_TraceLine(vector org, vector end, float nomonsters, entity forent)
}
void WarpZone_TraceLine(vector org, vector end, float nomonsters, entity forent)
WarpZone_Trace_InitTransform();
WarpZone_tracetoss_time = 0;
if(!warpzone_warpzones_exist)
WarpZone_Trace_InitTransform();
WarpZone_tracetoss_time = 0;
if(!warpzone_warpzones_exist)
- WarpZone_TraceToss_ThroughZone(e, forent, world, WarpZone_trace_callback_t_null);
+ WarpZone_TraceToss_ThroughZone(e, forent, NULL, WarpZone_trace_callback_t_null);
- WarpZone_TraceBox_ThroughZone(org, '0 0 0', '0 0 0', end, MOVE_NOMONSTERS, world, world, WarpZone_TrailParticles_trace_callback);
+ WarpZone_TraceBox_ThroughZone(org, '0 0 0', '0 0 0', end, MOVE_NOMONSTERS, NULL, NULL, WarpZone_TrailParticles_trace_callback);
WarpZone_TrailParticles_trace_callback_eff = eff;
WarpZone_TrailParticles_trace_callback_f = f;
WarpZone_TrailParticles_trace_callback_flags = boxflags | PARTICLES_DRAWASTRAIL;
WarpZone_TrailParticles_trace_callback_eff = eff;
WarpZone_TrailParticles_trace_callback_f = f;
WarpZone_TrailParticles_trace_callback_flags = boxflags | PARTICLES_DRAWASTRAIL;
- WarpZone_TraceBox_ThroughZone(org, '0 0 0', '0 0 0', end, MOVE_NOMONSTERS, world, world, WarpZone_TrailParticles_WithMultiplier_trace_callback);
+ WarpZone_TraceBox_ThroughZone(org, '0 0 0', '0 0 0', end, MOVE_NOMONSTERS, NULL, NULL, WarpZone_TrailParticles_WithMultiplier_trace_callback);
-float WarpZoneLib_ExactTrigger_Touch()
-{SELFPARAM();
- return !WarpZoneLib_BoxTouchesBrush(other.absmin, other.absmax, self, other);
+float WarpZoneLib_ExactTrigger_Touch(entity this, entity toucher)
+{
+ return !WarpZoneLib_BoxTouchesBrush(toucher.absmin, toucher.absmax, this, toucher);