From b1ebf5fb11ed6e42eac6e30dc38a82f351278659 Mon Sep 17 00:00:00 2001 From: s1lentq Date: Mon, 1 Feb 2016 16:17:00 +0600 Subject: [PATCH] Fix: Bug func_breakable with spawnflags pressure (when it is destroyed but you still will see it) --- regamedll/dlls/func_break.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/regamedll/dlls/func_break.cpp b/regamedll/dlls/func_break.cpp index 579a1bcf..7975869e 100644 --- a/regamedll/dlls/func_break.cpp +++ b/regamedll/dlls/func_break.cpp @@ -244,7 +244,6 @@ void CBreakable::__MAKE_VHOOK(Restart)(void) else pev->takedamage = DAMAGE_YES; - pev->deadflag = DEAD_NO; pev->health = m_flHealth; pev->effects &= ~EF_NODRAW; m_angle = pev->angles.y; @@ -508,11 +507,11 @@ void CBreakable::BreakTouch(CBaseEntity *pOther) UTIL_MakeVectors(pev->angles); g_vecAttackDir = gpGlobals->v_forward; - +#ifndef REGAMEDLL_FIXES pev->takedamage = DAMAGE_NO; pev->deadflag = DEAD_DEAD; pev->effects = EF_NODRAW; - +#endif // REGAMEDLL_FIXES Die(); } @@ -561,11 +560,11 @@ void CBreakable::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller pev->angles.y = m_angle; UTIL_MakeVectors(pev->angles); g_vecAttackDir = gpGlobals->v_forward; - +#ifndef REGAMEDLL_FIXES pev->takedamage = DAMAGE_NO; pev->deadflag = DEAD_DEAD; pev->effects = EF_NODRAW; - +#endif // REGAMEDLL_FIXES Die(); } } @@ -654,9 +653,11 @@ int CBreakable::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pev if (pev->health <= 0) { - pev->takedamage = 0; +#ifndef REGAMEDLL_FIXES + pev->takedamage = DAMAGE_NO; pev->deadflag = DEAD_DEAD; pev->effects = EF_NODRAW; +#endif // REGAMEDLL_FIXES Die(); if (m_flDelay == 0) @@ -685,6 +686,12 @@ void CBreakable::Die(void) int pitch; float fvol; +#ifdef REGAMEDLL_FIXES + pev->takedamage = DAMAGE_NO; + pev->deadflag = DEAD_DEAD; + pev->effects = EF_NODRAW; +#endif // REGAMEDLL_FIXES + pitch = 95 + RANDOM_LONG(0, 29); if (pitch > 97 && pitch < 103)