trigger_once: Implement the spawnflags that check for whether a monster/client is allowed to trigger.

This commit is contained in:
Marco Cawthorne 2020-08-07 09:58:52 +02:00
parent 287f88ecbd
commit 774eb4cf14

View file

@ -45,14 +45,19 @@ class trigger_once:CBaseTrigger
void void
trigger_once::touch(void) trigger_once::touch(void)
{ {
if (!(spawnflags & TO_MONSTERS) && other.spawnflags & FL_MONSTER)
return;
if (spawnflags & TO_NOCLIENTS && other.spawnflags & FL_CLIENT)
return;
eActivator = other; eActivator = other;
solid = SOLID_NOT; /* make inactive */
if (m_flDelay > 0) { if (m_flDelay > 0) {
CBaseTrigger::UseTargets_Delay(m_flDelay); CBaseTrigger::UseTargets_Delay(m_flDelay);
} else { } else {
CBaseTrigger::UseTargets(); CBaseTrigger::UseTargets();
} }
solid = SOLID_NOT;
} }
void void