set sv_qcweaponanimation 0
set g_telefrags 1 "telefragging, i.e. killing someone who stands in the way of someone who is teleporting"
+set g_telefrags_teamplay 1 "never telefrag team mates"
set g_telefrags_avoid 1 "when teleporters have a random destination, avoid teleporting to locations where a telefrag would happen"
set g_teleport_maxspeed 0 "maximum speed that a player can keep when going through a teleporter (if a misc_teleporter_dest also has a cap the smallest one of these will be used), 0 = don't limit, -1 = keep no speed"
float check_tdeath(entity player, vector org, vector telefragmin, vector telefragmax)
{
- TDEATHLOOP(org)
+ if (telefragger.classname == "player" && telefragger.health >= 1)
{
- if ((player.classname == "player") && (player.health >= 1))
+ TDEATHLOOP(org)
{
- if(head.classname == "player")
- if(head.health >= 1)
- return 1;
+ if not(teamplay && cvar("g_telefrags_teamplay") && head.team == telefragger.team)
+ if(head.classname == "player")
+ if(head.health >= 1)
+ return 1;
}
}
return 0;
{
TDEATHLOOP(player.origin)
{
- if ((player.classname == "player") && (player.health >= 1))
+ if (telefragger.classname == "player" && telefragger.health >= 1)
{
- if(head.classname == "player")
- if(head.health >= 1)
- ++tdeath_hit;
- Damage (head, teleporter, telefragger, 10000, DEATH_TELEFRAG, head.origin, '0 0 0');
+ if not(teamplay && cvar("g_telefrags_teamplay") && head.team == telefragger.team)
+ {
+ if(head.classname == "player")
+ if(head.health >= 1)
+ ++tdeath_hit;
+ Damage (head, teleporter, telefragger, 10000, DEATH_TELEFRAG, head.origin, '0 0 0');
+ }
}
- else if (telefragger.health < 1) // corpses gib
- Damage (head, teleporter, telefragger, 10000, DEATH_TELEFRAG, head.origin, '0 0 0');
else // dead bodies and monsters gib themselves instead of telefragging
Damage (telefragger, teleporter, telefragger, 10000, DEATH_TELEFRAG, telefragger.origin, '0 0 0');
}