// spread think times so they don't all happen at same time
self.nextthink = self.nextthink + random()*0.5 + 0.1;
self.iscreature = TRUE;
+ self.teleportable = TELEPORT_NORMAL;
self.damagedbycontents = TRUE;
force_retouch = 2; // mainly to detect teleports
}
}
self.iscreature = TRUE;
+ self.teleportable = TELEPORT_NORMAL;
self.damagedbycontents = TRUE;
force_retouch = 2; // mainly to detect teleports
}
}
self.iscreature = TRUE;
+ self.teleportable = TELEPORT_NORMAL;
self.damagedbycontents = TRUE;
force_retouch = 2; // mainly to detect teleports
self.classname = "observer";
self.iscreature = FALSE;
+ self.teleportable = TELEPORT_SIMPLE;
self.damagedbycontents = FALSE;
self.health = -666;
self.takedamage = DAMAGE_NO;
self.classname = "player";
self.wasplayer = TRUE;
self.iscreature = TRUE;
+ self.teleportable = TELEPORT_NORMAL;
self.damagedbycontents = TRUE;
self.movetype = MOVETYPE_WALK;
self.solid = SOLID_SLIDEBOX;
self.lip = oldself.lip;
self.colormap = oldself.colormap;
self.iscreature = oldself.iscreature;
+ self.teleportable = oldself.teleportable;
self.damagedbycontents = oldself.damagedbycontents;
self.angles = oldself.angles;
self.avelocity = oldself.avelocity;
.float damagedbycontents;
.float damagedbytriggers;
.float pushable;
+.float teleportable;
.vector oldvelocity;
.float pauseregen_finished;
flag.health = flag.max_flag_health;
flag.event_damage = ctf_FlagDamage;
flag.pushable = TRUE;
+ flag.teleportable = TELEPORT_NORMAL;
flag.damagedbytriggers = autocvar_g_ctf_flag_return_when_unreachable;
flag.damagedbycontents = autocvar_g_ctf_flag_return_when_unreachable;
flag.velocity = '0 0 0';
#define TELEPORT_FLAGS_WARPZONE 0
#define TELEPORT_FLAGS_PORTAL (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH | TELEPORT_FLAG_FORCE_TDEATH)
#define TELEPORT_FLAGS_TELEPORTER (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH)
+
+// types for .teleportable entity setting
+#define TELEPORT_NORMAL 1 // play sounds/effects etc
+#define TELEPORT_SIMPLE 2 // only do teleport, nothing special
+
void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity, vector telefragmin, vector telefragmax, float tflags)
{
entity telefragger;
makevectors (to_angles);
- 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(player.teleportable == TELEPORT_NORMAL) // don't play sounds or show particles for anything that isn't a player, maybe change later to block only observers
{
if(self.pushltime < time) // only show one teleport effect per teleporter per 0.2 seconds, for better fps
{
if (self.active != ACTIVE_ACTIVE)
return;
- if not(other.iscreature)
- return;
-
- // for gameplay: vehicles can't teleport
- if (other.vehicle_flags & VHF_ISVEHICLE)
+ if not(other.teleportable)
return;
- if(other.vehicle)
- return;
-
- if(other.turrcaps_flags & TFL_TURRCAPS_ISTURRET)
- return;
+ if(other.vehicle)
+ if(!other.vehicle.teleportable)
+ return;
+
+ if(other.turrcaps_flags & TFL_TURRCAPS_ISTURRET)
+ return;
- if (other.deadflag != DEAD_NO)
+ if(other.deadflag != DEAD_NO)
return;
if(self.team)
self.target_select_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
self.iscreature = TRUE;
+ self.teleportable = TELEPORT_NORMAL;
self.damagedbycontents = TRUE;
self.movetype = MOVETYPE_WALK;
self.solid = SOLID_SLIDEBOX;
self.target_select_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
self.iscreature = TRUE;
+ self.teleportable = TELEPORT_NORMAL;
self.damagedbycontents = TRUE;
self.movetype = MOVETYPE_WALK;
self.solid = SOLID_SLIDEBOX;
self.touch = vehicles_touch;
self.event_damage = vehicles_damage;
self.iscreature = TRUE;
+ self.teleportable = FALSE; // no teleporting for vehicles, too buggy
self.damagedbycontents = TRUE;
self.movetype = MOVETYPE_WALK;
self.solid = SOLID_SLIDEBOX;
self.takedamage = DAMAGE_AIM;
self.bot_attack = TRUE;
self.iscreature = TRUE;
+ self.teleportable = FALSE; // no teleporting for vehicles, too buggy
self.damagedbycontents = TRUE;
self.hud = vhud;