From d7f22ae3ecf9b895f1f9addf9dc4b7d1fa3cdd08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=82=AF=E5=AE=9A=E9=BE=99?= <52111952+overl4y@users.noreply.github.com> Date: Wed, 8 May 2024 15:18:24 +0000 Subject: [PATCH] Restart trigger_multiple (#935) --- 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 dc7bde074..c70a86526 100644 --- a/regamedll/dlls/multiplay_gamerules.cpp +++ b/regamedll/dlls/multiplay_gamerules.cpp @@ -652,6 +652,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 49e4d14c4..01e29bad8 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 b21a6bde5..90a7daef3 100644 --- a/regamedll/dlls/triggers.h +++ b/regamedll/dlls/triggers.h @@ -283,6 +283,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