Bugfix: trigger_hurt should not inflict more damage than established.

This commit is contained in:
s1lentq 2016-10-11 21:57:46 +07:00
parent cf95faadaf
commit 0006bac1a0

View File

@ -832,7 +832,11 @@ void CBaseTrigger::HurtTouch(CBaseEntity *pOther)
{ {
if (pev->dmgtime > gpGlobals->time) if (pev->dmgtime > gpGlobals->time)
{ {
#ifdef REGAMEDLL_FIXES
if (gpGlobals->time >= pev->pain_finished)
#else
if (gpGlobals->time != pev->pain_finished) if (gpGlobals->time != pev->pain_finished)
#endif
{ {
// too early to hurt again, and not same frame with a different entity // too early to hurt again, and not same frame with a different entity
if (!pOther->IsPlayer()) if (!pOther->IsPlayer())
@ -868,7 +872,11 @@ void CBaseTrigger::HurtTouch(CBaseEntity *pOther)
else else
{ {
// Original code -- single player // 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) if (pev->dmgtime > gpGlobals->time && gpGlobals->time != pev->pain_finished)
#endif
{ {
// too early to hurt again, and not same frame with a different entity // too early to hurt again, and not same frame with a different entity
return; return;