From 0006bac1a0df944c8954eec9fc45da1d8563946c Mon Sep 17 00:00:00 2001 From: s1lentq Date: Tue, 11 Oct 2016 21:57:46 +0700 Subject: [PATCH] Bugfix: trigger_hurt should not inflict more damage than established. --- regamedll/dlls/triggers.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/regamedll/dlls/triggers.cpp b/regamedll/dlls/triggers.cpp index f3d6a624..5bf87b70 100644 --- a/regamedll/dlls/triggers.cpp +++ b/regamedll/dlls/triggers.cpp @@ -832,7 +832,11 @@ void CBaseTrigger::HurtTouch(CBaseEntity *pOther) { if (pev->dmgtime > gpGlobals->time) { +#ifdef REGAMEDLL_FIXES + if (gpGlobals->time >= pev->pain_finished) +#else if (gpGlobals->time != pev->pain_finished) +#endif { // too early to hurt again, and not same frame with a different entity if (!pOther->IsPlayer()) @@ -868,7 +872,11 @@ void CBaseTrigger::HurtTouch(CBaseEntity *pOther) else { // Original code -- single player +#ifdef REGAMEDLL_FIXES + if (pev->dmgtime > gpGlobals->time && gpGlobals->time >= pev->pain_finished) +#else if (pev->dmgtime > gpGlobals->time && gpGlobals->time != pev->pain_finished) +#endif { // too early to hurt again, and not same frame with a different entity return;