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 <wopox1337@ya.ru>
This commit is contained in:
Adrian Cirstea 2022-12-16 12:10:01 +02:00 committed by GitHub
parent 9a001cabd1
commit 15e7d4a11e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -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()

View File

@ -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
}
}