float check_tdeath(entity player, vector org, vector telefragmin, vector telefragmax)
{
- if (telefragger.classname == "player" && telefragger.health >= 1)
+ if (player.classname == "player" && player.health >= 1)
{
TDEATHLOOP(org)
{
- if not(teamplay && cvar("g_telefrags_teamplay") && head.team == telefragger.team)
+ if not(teamplay && cvar("g_telefrags_teamplay") && head.team == player.team)
if(head.classname == "player")
if(head.health >= 1)
return 1;
{
TDEATHLOOP(player.origin)
{
- if (telefragger.classname == "player" && telefragger.health >= 1)
+ if (player.classname == "player" && player.health >= 1)
{
- if not(teamplay && cvar("g_telefrags_teamplay") && head.team == telefragger.team)
+ if not(teamplay && cvar("g_telefrags_teamplay") && head.team == player.team)
{
if(head.classname == "player")
if(head.health >= 1)
#define TELEPORT_FLAG_SOUND 1
#define TELEPORT_FLAG_PARTICLES 2
#define TELEPORT_FLAG_TDEATH 4
+#define TELEPORT_FLAG_FORCE_TDEATH 8
#define TELEPORT_FLAGS_WARPZONE 0
-#define TELEPORT_FLAGS_PORTAL (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES)
+#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)
void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity, vector telefragmin, vector telefragmax, float tflags)
{
if(player.classname == "player")
{
if(tflags & TELEPORT_FLAG_TDEATH)
- if(player.takedamage && player.deadflag == DEAD_NO && !g_race && !g_cts && cvar("g_telefrags"))
+ if(player.takedamage && player.deadflag == DEAD_NO && !g_race && !g_cts && (cvar("g_telefrags") || (tflags & TELEPORT_FLAG_FORCE_TDEATH)))
tdeath(player, teleporter, telefragger, telefragmin, telefragmax);
// player no longer is on ground
entity oldself, e;
vector o;
float p;
+ string s;
+ if (self.active != ACTIVE_ACTIVE)
+ return;
+
if (other.health < 1)
return;
if not(other.flags & FL_CLIENT) // FIXME: Make missiles firable through the teleport too
o = e.origin + '0 0 1' * (1 - other.mins_z - 24);
TeleportPlayer(self, other, o, e.mangle, v_forward * vlen(other.velocity), '0 0 0', '0 0 0', TELEPORT_FLAGS_TELEPORTER);
- if(e.target)
- {
- oldself = self;
- activator = other;
- self = e;
- SUB_UseTargets();
- self = oldself;
- }
+ activator = other;
+ s = self.target; self.target = string_null;
+ SUB_UseTargets();
+ if not(self.target) self.target = s;
+
+ oldself = self;
+ self = e;
+ SUB_UseTargets();
+ self = oldself;
}
void spawnfunc_info_teleport_destination (void)
self.angles = '0 0 0';
EXACTTRIGGER_INIT;
-
+
+ self.active = ACTIVE_ACTIVE;
+
self.use = trigger_teleport_use;
// this must be called to spawn the teleport waypoints for bots