makevectors (to_angles);
- if(self.pushltime < time) // only show one teleport effect per teleporter per 0.2 seconds, for better fps
+ if(player.classname == "player") // don't play sounds or show particles for anything that isn't a player, maybe change later to block only observers
{
- if(tflags & TELEPORT_FLAG_SOUND)
- sound (player, CH_TRIGGER, "misc/teleport.wav", VOL_BASE, ATTN_NORM);
- if(tflags & TELEPORT_FLAG_PARTICLES)
+ if(self.pushltime < time) // only show one teleport effect per teleporter per 0.2 seconds, for better fps
{
- pointparticles(particleeffectnum("teleport"), player.origin, '0 0 0', 1);
- pointparticles(particleeffectnum("teleport"), to + v_forward * 32, '0 0 0', 1);
+ if(tflags & TELEPORT_FLAG_SOUND)
- sound (player, CHAN_TRIGGER, "misc/teleport.wav", VOL_BASE, ATTN_NORM);
++ sound (player, CH_TRIGGER, "misc/teleport.wav", VOL_BASE, ATTN_NORM);
+ if(tflags & TELEPORT_FLAG_PARTICLES)
+ {
+ pointparticles(particleeffectnum("teleport"), player.origin, '0 0 0', 1);
+ pointparticles(particleeffectnum("teleport"), to + v_forward * 32, '0 0 0', 1);
+ }
+ self.pushltime = time + 0.2;
}
- self.pushltime = time + 0.2;
}
// Relocate the player
if (self.active != ACTIVE_ACTIVE)
return;
+ if not(other.iscreature)
+ if (other.deadflag != DEAD_NO)
return;
- if not(other.flags & FL_CLIENT) // FIXME: Make missiles firable through the teleport too
+
+ // for gameplay: vehicles can't teleport
+ if (other.vehicle_flags & VHF_ISVEHICLE)
+ return;
+
+ if (other.deadflag != DEAD_NO)
return;
if(self.team)
WarpZone_InitStep_UpdateTransform();
self = e;
WarpZones_Reconnect();
+ WarpZone_PostInitialize_Callback();
}
- 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;
- if(WarpZone_PlaneDist(self, e.origin + e.view_ofs) <= 0)
- WarpZone_Teleport(self, e, -1, 0); // 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!
++ if(WarpZone_PlaneDist(self, e.origin + e.view_ofs) <= 0)
++ WarpZone_Teleport(self, e, -1, 0); } // 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;