mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-26 22:55:41 +03:00
C4: Fixed a bug when a player died by explosive targets triggered by the main bomb (like is func_breakable around main bomb). (This is bug can be cause undefined behavior end round)
This commit is contained in:
parent
f16333c9d6
commit
dd59006db0
@ -223,6 +223,19 @@ void CGrenade::__API_HOOK(Explode2)(TraceResult *pTrace, int bitsDamageType)
|
||||
Create("spark_shower", pev->origin, pTrace->vecPlaneNormal, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef REGAMEDLL_FIXES
|
||||
// A bomb has exploded so let's to trigger other explosive targets
|
||||
if (m_pentCurBombTarget)
|
||||
{
|
||||
auto pBombTarget = CBaseEntity::Instance(m_pentCurBombTarget);
|
||||
if (pBombTarget)
|
||||
{
|
||||
pBombTarget->Use(CBaseEntity::Instance(pevOwner), this, USE_TOGGLE, 0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
LINK_HOOK_CLASS_VOID_CUSTOM2_CHAIN(CGrenade, ExplodeHeGrenade, Explode3, (TraceResult *pTrace, int bitsDamageType), pTrace, bitsDamageType)
|
||||
@ -1403,14 +1416,17 @@ void CGrenade::C4Think()
|
||||
WRITE_BYTE(0);
|
||||
MESSAGE_END();
|
||||
|
||||
#ifndef REGAMEDLL_FIXES
|
||||
// BUG: Don't trigger targets until main bomb explodes (Moved to CGrenade::Explode2)
|
||||
if (m_pentCurBombTarget)
|
||||
{
|
||||
CBaseEntity *pBombTarget = CBaseEntity::Instance(m_pentCurBombTarget);
|
||||
auto pBombTarget = CBaseEntity::Instance(m_pentCurBombTarget);
|
||||
if (pBombTarget)
|
||||
{
|
||||
pBombTarget->Use(CBaseEntity::Instance(pev->owner), this, USE_TOGGLE, 0);
|
||||
}
|
||||
}
|
||||
#endif // #ifndef REGAMEDLL_FIXES
|
||||
|
||||
CBasePlayer *pBombOwner = CBasePlayer::Instance(pev->owner);
|
||||
if (pBombOwner)
|
||||
|
Loading…
Reference in New Issue
Block a user