#ifdef SVQC
void trigger_disablerelay_use(entity this, entity actor, entity trigger)
{
+ if(this.active != ACTIVE_ACTIVE)
+ return;
+
int a = 0, b = 0;
for(entity e = NULL; (e = find(e, targetname, this.target)); )
{
- if(e.use == SUB_UseTargets)
+ if(e.active == ACTIVE_ACTIVE)
{
- e.use = SUB_DontUseTargets;
+ e.active = ACTIVE_NOT;
++a;
}
- else if(e.use == SUB_DontUseTargets)
+ else if(e.active == ACTIVE_NOT)
{
- e.use = SUB_UseTargets;
+ e.active = ACTIVE_ACTIVE;
++b;
}
}
spawnfunc(trigger_disablerelay)
{
+ this.reset = spawnfunc_trigger_disablerelay; // this spawnfunc resets fully
+ this.active = ACTIVE_ACTIVE;
this.use = trigger_disablerelay_use;
}
#endif
#ifdef SVQC
void trigger_relay_if_use(entity this, entity actor, entity trigger)
{
+ if(this.active != ACTIVE_ACTIVE)
+ return;
+
int n = this.count;
// TODO make this generic AND faster than nextent()ing through all, if somehow possible
spawnfunc(trigger_relay_if)
{
+ this.reset = spawnfunc_trigger_relay_if; // this spawnfunc resets fully
+ this.active = ACTIVE_ACTIVE;
this.use = trigger_relay_if_use;
}
#endif
#ifdef SVQC
void trigger_relay_teamcheck_use(entity this, entity actor, entity trigger)
{
+ if(this.active != ACTIVE_ACTIVE)
+ return;
+
if(actor.team)
{
if(this.spawnflags & RELAYTEAMCHECK_INVERT)
void trigger_relay_teamcheck_reset(entity this)
{
+ this.active = ACTIVE_ACTIVE;
this.team = this.team_saved;
}
spawnfunc(trigger_relay_teamcheck)
{
+ this.active = ACTIVE_ACTIVE;
this.team_saved = this.team;
IL_PUSH(g_saved_team, this);
this.use = trigger_relay_teamcheck_use;