ts.SendEntity3 = WarpZone_Teleported_Send;
ts.SendFlags = 0xFFFFFF;
ts.drawonlytoclient = player;
- ts.think = SUB_Remove_self;
+ setthink(ts, SUB_Remove);
ts.nextthink = time + 1;
ts.owner = player;
ts.enemy = wz;
return 1;
}
-void WarpZone_Touch ()
-{SELFPARAM();
+void WarpZone_Touch (entity this)
+{
if(other.classname == "trigger_warpzone")
return;
#endif
return;
- if(WarpZoneLib_ExactTrigger_Touch())
+ if(WarpZoneLib_ExactTrigger_Touch(self, other))
return;
#ifdef SVQC
#ifdef WARPZONELIB_KEEPDEBUG
float WarpZone_CheckProjectileImpact(entity player)
-{SELFPARAM();
+{
vector o0, v0;
.vector orgvec, velvec;
#endif
#endif
-float WarpZone_Projectile_Touch()
-{SELFPARAM();
+float WarpZone_Projectile_Touch(entity this)
+{
if(other.classname == "trigger_warpzone")
return true;
save_ent = trace_ent;
save_inopen = trace_inopen;
save_inwater = trace_inwater;
- float f;
- if((f = WarpZone_CheckProjectileImpact(this)) != 0)
- return (f > 0);
+ float f = WarpZone_CheckProjectileImpact(this);
+ if (f) return (f > 0);
trace_dpstartcontents = save_dpstartcontents;
trace_dphitcontents = save_dphitcontents;
trace_dphitq3surfaceflags = save_dphitq3surfaceflags;
this.enemy.aiment = this;
}
-void WarpZoneCamera_Think()
-{SELFPARAM();
+void WarpZoneCamera_Think(entity this)
+{
if(this.warpzone_save_origin != this.origin
|| this.warpzone_save_angles != this.angles
|| this.warpzone_save_eorigin != this.enemy.origin
this.SendFlags = 0xFFFFFF;
if(this.spawnflags & 1)
{
- this.think = WarpZoneCamera_Think;
+ setthink(this, WarpZoneCamera_Think);
this.nextthink = time;
}
else
}
}
-void WarpZone_Think();
+void WarpZone_Think(entity this);
void WarpZone_InitStep_FinalizeTransform(entity this)
{
if(!this.enemy || this.enemy.enemy != this)
warpzone_warpzones_exist = 1;
WarpZone_SetUp(this, this.warpzone_origin, this.warpzone_angles, this.enemy.warpzone_origin, this.enemy.warpzone_angles);
- this.touch = WarpZone_Touch;
+ settouch(this, WarpZone_Touch);
this.SendFlags = 0xFFFFFF;
if(this.spawnflags & 1)
{
- this.think = WarpZone_Think;
+ setthink(this, WarpZone_Think);
this.nextthink = time;
}
else
this.scale = 1;
string m;
m = this.model;
- WarpZoneLib_ExactTrigger_Init();
+ WarpZoneLib_ExactTrigger_Init(this);
if(m != "")
{
precache_model(m);
WarpZone_InitStep_FinalizeTransform(e);
}
-void WarpZone_Think()
-{SELFPARAM();
+void WarpZone_Think(entity this)
+{
if(this.warpzone_save_origin != this.origin
|| this.warpzone_save_angles != this.angles
|| this.warpzone_save_eorigin != this.enemy.origin
void WarpZone_StartFrame()
{
- SELFPARAM();
if (!warpzone_initialized)
{
warpzone_initialized = true;
// warpzones
if (warpzone_warpzones_exist) {
- setself(WarpZone_Find(it.origin + it.mins, it.origin + it.maxs));
- if (self)
- if (!WarpZoneLib_ExactTrigger_Touch())
- if (WarpZone_PlaneDist(self, it.origin + it.view_ofs) <= 0)
- WarpZone_Teleport(self, it, -1, 0); // NOT triggering targets by this!
+ entity e = WarpZone_Find(it.origin + it.mins, it.origin + it.maxs);
+ if (e)
+ if (!WarpZoneLib_ExactTrigger_Touch(e, other))
+ if (WarpZone_PlaneDist(e, it.origin + it.view_ofs) <= 0)
+ WarpZone_Teleport(e, it, -1, 0); // NOT triggering targets by this!
}
// teleporters
if(other.teleportable)
{
- setself(Teleport_Find(it.origin + it.mins, it.origin + it.maxs));
- if (self)
- if (!WarpZoneLib_ExactTrigger_Touch())
- Simple_TeleportPlayer(self, other); // NOT triggering targets by this!
+ entity ent = Teleport_Find(it.origin + it.mins, it.origin + it.maxs);
+ if (ent)
+ if (!WarpZoneLib_ExactTrigger_Touch(ent, other))
+ Simple_TeleportPlayer(ent, other); // NOT triggering targets by this!
}
}
});
- setself(this);
other = oldother;
}