WarpZone_PostTeleportPlayer_Callback(player);
}
+ float WarpZone_Teleported_Send(entity to, float sf)
+ {
+ WriteByte(MSG_ENTITY, ENT_CLIENT_WARPZONE_TELEPORTED);
+ WriteCoord(MSG_ENTITY, self.angles_x);
+ WriteCoord(MSG_ENTITY, self.angles_y);
+ WriteCoord(MSG_ENTITY, self.angles_z);
+ return TRUE;
+ }
+
float WarpZone_Teleport(entity player)
{
vector o0, a0, v0, o1, a1, v1;
WarpZone_StoreProjectileData(player);
player.warpzone_teleport_time = time;
player.warpzone_teleport_zone = self;
+ #ifndef WARPZONE_USE_FIXANGLE
+ // instead of fixangle, send the transform to the client for smoother operation
+ player.fixangle = FALSE;
+
+ entity ts = spawn();
+ setmodel(ts, "null");
+ ts.SendEntity = WarpZone_Teleported_Send;
+ ts.SendFlags = 0xFFFFFF;
+ ts.drawonlytoclient = player;
+ ts.think = SUB_Remove;
+ ts.nextthink = time + 1;
+ ts.owner = player;
+ ts.enemy = self;
+ ts.effects = EF_NODEPTHTEST;
+ ts.classname = "warpzone_teleported";
+ ts.angles = self.warpzone_transform;
+ #endif
return 1;
}
WarpZones_Reconnect();
}
- if(warpzone_warpzones_exist)
+ entity oldself, oldother;
+ oldself = self;
+ oldother = other;
+ for(e = world; (e = nextent(e)); )
{
- entity oldself, oldother;
- oldself = self;
- oldother = other;
- for(e = world; (e = nextent(e)); )
+ if(warpzone_warpzones_exist) { WarpZone_StoreProjectileData(e); }
+
+ float f = clienttype(e);
+ if(f == CLIENTTYPE_REAL)
{
- WarpZone_StoreProjectileData(e);
- float f;
- f = clienttype(e);
- if(f == CLIENTTYPE_REAL)
+ if(e.solid == SOLID_NOT) // not spectating?
+ if(e.movetype == MOVETYPE_NOCLIP || e.movetype == MOVETYPE_FLY) // not spectating? (this is to catch observers)
{
- if(e.solid != SOLID_NOT) // not spectating?
- continue;
- if(e.movetype != MOVETYPE_NOCLIP && e.movetype != MOVETYPE_FLY) // not spectating? (this is to catch observers)
- continue;
- self = WarpZone_Find(e.origin + e.mins, e.origin + e.maxs);
- if(!self)
- continue;
- other = e;
- if(WarpZoneLib_ExactTrigger_Touch())
- continue;
- WarpZone_Teleport(e); // NOT triggering targets by this!
+ other = e; // player
+
+ // warpzones
+ if(warpzone_warpzones_exist) {
+ self = WarpZone_Find(e.origin + e.mins, e.origin + e.maxs);
+ if(self)
+ if(!WarpZoneLib_ExactTrigger_Touch())
+ WarpZone_Teleport(e); } // NOT triggering targets by this!
+
+ // teleporters
+ self = Teleport_Find(e.origin + e.mins, e.origin + e.maxs);
+ if(self)
+ if(!WarpZoneLib_ExactTrigger_Touch())
+ Simple_TeleportPlayer(self, other); // NOT triggering targets by this!
}
- if(f == CLIENTTYPE_NOTACLIENT)
- {
+ }
+
+ if(f == CLIENTTYPE_NOTACLIENT)
+ {
+ if(warpzone_warpzones_exist)
for(; (e = nextent(e)); )
WarpZone_StoreProjectileData(e);
- break;
- }
+ break;
}
- self = oldself;
- other = oldother;
}
+ self = oldself;
+ other = oldother;
}
.float warpzone_reconnecting;