trigger_once: spawnflag TO_PUSHABLES should also affect other func_ entities, it appears.

This commit is contained in:
Marco Cawthorne 2023-09-22 16:21:01 -07:00
parent b50b803b55
commit e1fd04de05
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
1 changed files with 5 additions and 1 deletions

View File

@ -124,13 +124,16 @@ trigger_once::SpawnKey(string strKey, string strValue)
void
trigger_once::Touch(entity eToucher)
{
bool isPushable = (substring(eToucher.classname, 0, 5) == "func_") ? true : false;
if (GetMaster() == FALSE)
return;
if (HasSpawnFlags(TO_NOCLIENTS) && eToucher.flags & FL_CLIENT)
return;
if (!HasSpawnFlags(TO_MONSTERS) && eToucher.flags & FL_MONSTER)
return;
if (!HasSpawnFlags(TO_PUSHABLES) && eToucher.classname == "func_pushable")
if (!HasSpawnFlags(TO_PUSHABLES) && isPushable == true)
return;
SetSolid(SOLID_NOT); /* make inactive */
@ -141,5 +144,6 @@ trigger_once::Touch(entity eToucher)
return;
}
print(sprintf("%s is triggering %s in trigger_once\n", eToucher.classname, target));
UseTargets(eToucher, TRIG_TOGGLE, m_flDelay);
}