From 9374fced908d64d8dbc90c878605925b151078fa Mon Sep 17 00:00:00 2001 From: s1lent Date: Wed, 1 Nov 2017 22:27:19 +0700 Subject: [PATCH] Fixes dreamstalker/rehlds#402 --- regamedll/dlls/gamerules.h | 4 ---- regamedll/dlls/multiplay_gamerules.cpp | 10 +++++----- regamedll/dlls/plats.cpp | 4 +--- regamedll/dlls/triggers.cpp | 8 ++++++++ 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/regamedll/dlls/gamerules.h b/regamedll/dlls/gamerules.h index 258ef742..af4da1a6 100644 --- a/regamedll/dlls/gamerules.h +++ b/regamedll/dlls/gamerules.h @@ -50,10 +50,6 @@ const int MAX_INTERMISSION_TIME = 120; // longest the intermission can last, in // marked with the ITEM_FLAG_LIMITINWORLD will delay their respawn const int ENTITY_INTOLERANCE = 100; -// custom enum -#define WINNER_NONE 0 -#define WINNER_DRAW 1 - enum { WINSTATUS_NONE = 0, diff --git a/regamedll/dlls/multiplay_gamerules.cpp b/regamedll/dlls/multiplay_gamerules.cpp index d88247f9..96cd6f3b 100644 --- a/regamedll/dlls/multiplay_gamerules.cpp +++ b/regamedll/dlls/multiplay_gamerules.cpp @@ -319,7 +319,7 @@ CHalfLifeMultiplay::CHalfLifeMultiplay() m_iAccountCT = 0; m_iAccountTerrorist = 0; m_iHostagesRescued = 0; - m_iRoundWinStatus = WINNER_NONE; + m_iRoundWinStatus = WINSTATUS_NONE; m_iNumCTWins = 0; m_iNumTerroristWins = 0; m_pVIP = nullptr; @@ -802,11 +802,11 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(CheckWinConditions)() #ifdef REGAMEDLL_FIXES // If a winner has already been determined.. then get the heck out of here - if (m_iRoundWinStatus != WINNER_NONE) + if (m_iRoundWinStatus != WINSTATUS_NONE) return; #else // If a winner has already been determined and game of started.. then get the heck out of here - if (m_bGameStarted && m_iRoundWinStatus != WINNER_NONE) + if (m_bGameStarted && m_iRoundWinStatus != WINSTATUS_NONE) return; #endif @@ -1969,7 +1969,7 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(RestartRound)() m_iAccountTerrorist = m_iAccountCT = 0; m_iHostagesRescued = 0; m_iHostagesTouched = 0; - m_iRoundWinStatus = WINNER_NONE; + m_iRoundWinStatus = WINSTATUS_NONE; m_bTargetBombed = m_bBombDefused = false; m_bLevelInitialized = false; m_bCompleteReset = false; @@ -3014,7 +3014,7 @@ bool CHalfLifeMultiplay::HasRoundTimeExpired() #endif // We haven't completed other objectives, so go for this!. - if (GetRoundRemainingTime() > 0 || m_iRoundWinStatus != WINNER_NONE) + if (GetRoundRemainingTime() > 0 || m_iRoundWinStatus != WINSTATUS_NONE) { return false; } diff --git a/regamedll/dlls/plats.cpp b/regamedll/dlls/plats.cpp index c4b326b0..28cd0827 100644 --- a/regamedll/dlls/plats.cpp +++ b/regamedll/dlls/plats.cpp @@ -977,14 +977,12 @@ void CFuncTrackTrain::Blocked(CBaseEntity *pOther) ALERT(at_aiconsole, "TRAIN(%s): Blocked by %s (dmg:%.2f)\n", STRING(pev->targetname), STRING(pOther->pev->classname), pev->dmg); - // TODO: is missing? -#if 0 +#ifdef REGAMEDLL_FIXES if (pev->dmg <= 0) return; // we can't hurt this thing, so we're not concerned with it pOther->TakeDamage(pev, pev, pev->dmg, DMG_CRUSH); - #endif } diff --git a/regamedll/dlls/triggers.cpp b/regamedll/dlls/triggers.cpp index 1d5b97db..7d521029 100644 --- a/regamedll/dlls/triggers.cpp +++ b/regamedll/dlls/triggers.cpp @@ -745,7 +745,15 @@ void CTriggerHurt::Spawn() #ifdef REGAMEDLL_FIXES void CTriggerHurt::Restart() { + Vector mins, maxs; + + // Set model is about to destroy these + mins = pev->mins; + maxs = pev->maxs; + Spawn(); + + UTIL_SetSize(pev, mins, maxs); } #endif