From 09d6f412da670f6fe9f24e13423669b0ea0c0d3c Mon Sep 17 00:00:00 2001 From: techhex Date: Wed, 24 Jan 2024 20:47:18 -0400 Subject: [PATCH] Restart trigger_multiple --- regamedll/dlls/multiplay_gamerules.cpp | 1 + regamedll/dlls/triggers.cpp | 8 ++++++++ regamedll/dlls/triggers.h | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/regamedll/dlls/multiplay_gamerules.cpp b/regamedll/dlls/multiplay_gamerules.cpp index 229da7c18..6ada95eae 100644 --- a/regamedll/dlls/multiplay_gamerules.cpp +++ b/regamedll/dlls/multiplay_gamerules.cpp @@ -648,6 +648,7 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(CleanUpMap)() UTIL_RestartOther("env_beam"); UTIL_RestartOther("env_laser"); UTIL_RestartOther("trigger_auto"); + UTIL_RestartOther("trigger_multiple"); #endif // Remove grenades and C4 diff --git a/regamedll/dlls/triggers.cpp b/regamedll/dlls/triggers.cpp index c4af258c4..82b227a35 100644 --- a/regamedll/dlls/triggers.cpp +++ b/regamedll/dlls/triggers.cpp @@ -996,6 +996,14 @@ void CTriggerMultiple::Spawn() } } +#ifdef REGAMEDLL_FIXES +void CTriggerMultiple::Restart() +{ + pev->nextthink = -1; + Spawn(); +} +#endif + LINK_ENTITY_TO_CLASS(trigger_once, CTriggerOnce, CCSTriggerOnce) void CTriggerOnce::Spawn() diff --git a/regamedll/dlls/triggers.h b/regamedll/dlls/triggers.h index c16f969c8..85ba33633 100644 --- a/regamedll/dlls/triggers.h +++ b/regamedll/dlls/triggers.h @@ -278,6 +278,10 @@ class CTriggerMultiple: public CBaseTrigger { public: virtual void Spawn(); + +#ifdef REGAMEDLL_FIXES + virtual void Restart(); +#endif }; // Variable sized trigger. Triggers once, then removes itself. You must set the key "target" to the name of another object in the level that has a matching