mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-04-08 18:50:04 +03:00
Fix defuse behavior when bomb explodes
- Ensure DefuseBombEnd is called when defusing and bomb explodes to properly stop defuse - Fixes the issue where defuse progress bar continued draw after bomb explosion
This commit is contained in:
parent
0fc5213049
commit
312dc3eb84
@ -1170,6 +1170,12 @@ void CGrenade::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useTy
|
||||
if (!m_bIsC4)
|
||||
return;
|
||||
|
||||
#ifdef REGAMEDLL_FIXES
|
||||
// block the start of defuse if the bomb timer has expired
|
||||
if (m_flC4Blow > 0 && gpGlobals->time >= m_flC4Blow)
|
||||
return;
|
||||
#endif
|
||||
|
||||
// TODO: We must be sure that the activator is a player.
|
||||
CBasePlayer *pPlayer = GetClassPtr<CCSPlayer>((CBasePlayer *)pActivator->pev);
|
||||
|
||||
@ -1503,6 +1509,13 @@ void CGrenade::C4Think()
|
||||
{
|
||||
DefuseBombEnd(pPlayer, false);
|
||||
}
|
||||
#ifdef REGAMEDLL_FIXES
|
||||
// if the bomb timer has expired and defuse is still ongoing, stop the defuse
|
||||
else if (gpGlobals->time >= m_flC4Blow)
|
||||
{
|
||||
DefuseBombEnd(pPlayer, false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user