Skip to content

Commit

Permalink
add "keep !activator" flag to trigger_relay
Browse files Browse the repository at this point in the history
  • Loading branch information
wootguy committed Sep 14, 2024
1 parent 1177fc8 commit ca1c1fd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dlls/triggers/CTriggerRelay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "cbase.h"

#define SF_RELAY_FIREONCE 0x0001
#define SF_RELAY_KEEP_ACTIVATOR 64

class CTriggerRelay : public CBaseDelay
{
Expand Down Expand Up @@ -60,7 +61,9 @@ void CTriggerRelay::Spawn(void)

void CTriggerRelay::Use(CBaseEntity* pActivator, CBaseEntity* pCaller, USE_TYPE useType, float value)
{
SUB_UseTargets(this, triggerType, 0);
CBaseEntity* activator = (pev->spawnflags & SF_RELAY_KEEP_ACTIVATOR) ? pActivator : this;

SUB_UseTargets(activator, triggerType, 0);
if (pev->spawnflags & SF_RELAY_FIREONCE)
UTIL_Remove(this);
}

0 comments on commit ca1c1fd

Please sign in to comment.