self.iscreature = FALSE;
self.health = -666;
self.takedamage = DAMAGE_NO;
- self.solid = SOLID_NOT;
- self.movetype = MOVETYPE_NOCLIP;
+ self.solid = SOLID_TRIGGER; // FIXME: SOLID_TRIGGER doesn't work for doors, and SOLID_NOT doesn't work for teleporters... can we do what warpzones do to fix this?
+ self.movetype = MOVETYPE_FLY;
self.flags = FL_CLIENT | FL_NOTARGET;
self.armorvalue = 666;
self.effects = 0;
self.fixangle = TRUE;
self.crouch = FALSE;
- self.view_ofs = PL_VIEW_OFS;
+ self.view_ofs = '0 0 0'; // so that you can't go inside walls with MOVETYPE_FLY, previously "PL_VIEW_OFS" - for some reason this is diff from normal players
setorigin (self, spot.origin);
- setsize (self, '0 0 0', '0 0 0');
+ setsize (self, '-16 -16 -24', '16 16 24'); // so that you can't go inside walls with MOVETYPE_FLY
self.prevorigin = self.origin;
self.items = 0;
self.weapons = 0;
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, CHAN_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);
+ 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 (other.health < 1)
+ if (other.deadflag != DEAD_NO) // Samual: Allow observers, instead of health value lets use deadflags
return;
if not(other.flags & FL_CLIENT) // FIXME: Make missiles firable through the teleport too
return;