void WarpZone_TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity)
{
#ifdef SVQC
- setorigin (player, to); // NOTE: this also aborts the move, when this is called by touch
+ setorigin(player, to); // NOTE: this also aborts the move, when this is called by touch
player.oldorigin = to; // for DP's unsticking
player.angles = to_angles;
player.fixangle = true;
{
entity own;
own = player.owner;
- player.owner = world;
+ player.owner = NULL;
tracebox(trace_endpos, player.mins, player.maxs, o1 - player.view_ofs + v1 * frametime * f1, MOVE_NORMAL, player); // this should get us through the warpzone
player.owner = own;
}
entity ts = new(warpzone_teleported);
setmodel(ts, MDL_Null);
- ts.SendEntity = SendEntity_self;
- ts.SendEntity3 = WarpZone_Teleported_Send;
+ setSendEntity(ts, WarpZone_Teleported_Send);
ts.SendFlags = 0xFFFFFF;
ts.drawonlytoclient = player;
setthink(ts, SUB_Remove);
#endif
return;
- if(WarpZoneLib_ExactTrigger_Touch(self, other))
+ if(WarpZoneLib_ExactTrigger_Touch(this, other))
return;
#ifdef SVQC
}
#endif
- if(WarpZone_Projectile_Touch_ImpactFilter_Callback())
+ if(WarpZone_Projectile_Touch_ImpactFilter_Callback(this, other))
return true;
#endif
{
if(this.killtarget != "")
{
- this.aiment = find(world, targetname, this.killtarget);
- if(this.aiment == world)
+ this.aiment = find(NULL, targetname, this.killtarget);
+ if(this.aiment == NULL)
{
error("Warp zone with nonexisting killtarget");
return;
error("Warp zone position with no target");
return;
}
- this.enemy = find(world, targetname, this.target);
- if(this.enemy == world)
+ this.enemy = find(NULL, targetname, this.target);
+ if(this.enemy == NULL)
{
error("Warp zone position with nonexisting target");
return;
error("Camera with no target");
return;
}
- this.enemy = world;
- for(e = world, i = 0; (e = find(e, targetname, this.target)); )
+ this.enemy = NULL;
+ for(e = NULL, i = 0; (e = find(e, targetname, this.target)); )
if(random() * ++i < 1)
this.enemy = e;
- if(this.enemy == world)
+ if(this.enemy == NULL)
{
error("Camera with nonexisting target");
return;
void WarpZone_InitStep_ClearTarget(entity this)
{
if(this.enemy)
- this.enemy.enemy = world;
- this.enemy = world;
+ this.enemy.enemy = NULL;
+ this.enemy = NULL;
}
entity warpzone_first; .entity warpzone_next;
{
this.enemy = this; // so the if(!e.enemy) check also skips this, saves one IF
- e2 = world;
- for(e = world, i = 0; (e = find(e, targetname, this.target)); )
+ e2 = NULL;
+ for(e = NULL, i = 0; (e = find(e, targetname, this.target)); )
if(!e.enemy)
if(e.classname == this.classname) // possibly non-warpzones may use the same targetname!
if(random() * ++i < 1)
e2 = e;
if(!e2)
{
- this.enemy = world;
+ this.enemy = NULL;
error("Warpzone with non-existing target");
return;
}
setsize(this, this.mins * this.scale, this.maxs * this.scale);
else
setsize(this, this.mins, this.maxs);
- this.SendEntity = SendEntity_self;
- this.SendEntity3 = WarpZone_Send;
+ setSendEntity(this, WarpZone_Send);
this.SendFlags = 0xFFFFFF;
BITSET_ASSIGN(this.effects, EF_NODEPTHTEST);
this.warpzone_next = warpzone_first;
this.solid = SOLID_BSP;
else if(this.solid < 0)
this.solid = SOLID_NOT;
- this.SendEntity = SendEntity_self;
- this.SendEntity3 = WarpZone_Camera_Send;
+ setSendEntity(this, WarpZone_Camera_Send);
this.SendFlags = 0xFFFFFF;
this.warpzone_next = warpzone_camera_first;
warpzone_camera_first = this;