trigger_teleport: respect the 'master' value, support for spawnflags 1 and 2.

This commit is contained in:
Marco Cawthorne 2020-06-12 13:02:14 +02:00
parent 4fe5166fd1
commit a3ade0deab

View file

@ -22,6 +22,12 @@ Teleportation volume. Teleports anything it touches to the position of
any entity set as the "target". Works best with info_teleport_destination.
*/
enumflags
{
TRIGTELE_MONSTERS,
TRIGTELE_NOCLIENTS
};
class trigger_teleport:CBaseTrigger
{
void(void) trigger_teleport;
@ -32,6 +38,13 @@ class trigger_teleport:CBaseTrigger
void
trigger_teleport::touch(void)
{
if (GetMaster() == FALSE)
return;
if (spawnflags & TRIGTELE_NOCLIENTS && other.flags & FL_CLIENT)
return;
if (spawnflags & TRIGTELE_MONSTERS && !(other.flags & FL_MONSTER))
return;
if (other.health > 0 || other.solid == SOLID_SLIDEBOX) {
eActivator = other;
entity eTarget = find(world, CBaseTrigger::m_strTargetName, m_strTarget);