From 15e7d4a11e9279693e528b571a5dba606900f98c Mon Sep 17 00:00:00 2001 From: Adrian Cirstea <54354938+ShadowsAdi@users.noreply.github.com> Date: Fri, 16 Dec 2022 12:10:01 +0200 Subject: [PATCH] Implement `game_round_start` & `game_entity_restart` triggers (#754) * Added `game_entity_restart` for entities and `game_round_start` for round start Co-authored-by: Sergey Shorokhov --- regamedll/dlls/multiplay_gamerules.cpp | 8 ++++++++ regamedll/dlls/util.cpp | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/regamedll/dlls/multiplay_gamerules.cpp b/regamedll/dlls/multiplay_gamerules.cpp index 2a8821d9..659d349e 100644 --- a/regamedll/dlls/multiplay_gamerules.cpp +++ b/regamedll/dlls/multiplay_gamerules.cpp @@ -2035,6 +2035,10 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(RestartRound)() #endif pPlayer->RoundRespawn(); + +#ifdef REGAMEDLL_ADD + FireTargets("game_entity_restart", pPlayer, nullptr, USE_TOGGLE, 0.0); +#endif } // Gooseman : The following code fixes the HUD icon bug @@ -2073,6 +2077,10 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(RestartRound)() m_bTargetBombed = m_bBombDefused = false; m_bLevelInitialized = false; m_bCompleteReset = false; + +#ifdef REGAMEDLL_ADD + FireTargets("game_round_start", nullptr, nullptr, USE_TOGGLE, 0.0); +#endif } BOOL CHalfLifeMultiplay::IsThereABomber() diff --git a/regamedll/dlls/util.cpp b/regamedll/dlls/util.cpp index 6c10ca40..d508ed6e 100644 --- a/regamedll/dlls/util.cpp +++ b/regamedll/dlls/util.cpp @@ -1497,6 +1497,10 @@ void UTIL_RestartOther(const char *szClassname) while ((pEntity = UTIL_FindEntityByClassname(pEntity, szClassname))) { pEntity->Restart(); + +#ifdef REGAMEDLL_ADD + FireTargets("game_entity_restart", pEntity, nullptr, USE_TOGGLE, 0.0); +#endif } }