mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-04-24 15:33:38 +03:00
Fix some of C4 related bugs. (#179)
- Cancel C4 planting bartime on weapon change - Infinite round, when bomb exploded underwater - C4 explode after defuse - Moving while defusing and silent defuse (partially) - Silent defuse
This commit is contained in:
parent
b27d7bc05e
commit
8b1be212bf
@ -983,7 +983,9 @@ void CGrenade::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useTy
|
|||||||
|
|
||||||
// TODO show messages on clients on event
|
// TODO show messages on clients on event
|
||||||
ClientPrint(player->pev, HUD_PRINTCENTER, "#Defusing_Bomb_With_Defuse_Kit");
|
ClientPrint(player->pev, HUD_PRINTCENTER, "#Defusing_Bomb_With_Defuse_Kit");
|
||||||
|
#ifndef REGAMEDLL_FIXES
|
||||||
EMIT_SOUND(ENT(player->pev), CHAN_ITEM, "weapons/c4_disarm.wav", VOL_NORM, ATTN_NORM);
|
EMIT_SOUND(ENT(player->pev), CHAN_ITEM, "weapons/c4_disarm.wav", VOL_NORM, ATTN_NORM);
|
||||||
|
#endif
|
||||||
|
|
||||||
player->m_bIsDefusing = true;
|
player->m_bIsDefusing = true;
|
||||||
m_pBombDefuser = pActivator;
|
m_pBombDefuser = pActivator;
|
||||||
@ -1003,7 +1005,9 @@ void CGrenade::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useTy
|
|||||||
|
|
||||||
// TODO: show messages on clients on event
|
// TODO: show messages on clients on event
|
||||||
ClientPrint(player->pev, HUD_PRINTCENTER, "#Defusing_Bomb_Without_Defuse_Kit");
|
ClientPrint(player->pev, HUD_PRINTCENTER, "#Defusing_Bomb_Without_Defuse_Kit");
|
||||||
|
#ifndef REGAMEDLL_FIXES
|
||||||
EMIT_SOUND(ENT(player->pev), CHAN_ITEM, "weapons/c4_disarm.wav", VOL_NORM, ATTN_NORM);
|
EMIT_SOUND(ENT(player->pev), CHAN_ITEM, "weapons/c4_disarm.wav", VOL_NORM, ATTN_NORM);
|
||||||
|
#endif
|
||||||
|
|
||||||
player->m_bIsDefusing = true;
|
player->m_bIsDefusing = true;
|
||||||
m_pBombDefuser = pActivator;
|
m_pBombDefuser = pActivator;
|
||||||
@ -1014,6 +1018,10 @@ void CGrenade::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useTy
|
|||||||
// start the progress bar
|
// start the progress bar
|
||||||
player->SetProgressBarTime(10);
|
player->SetProgressBarTime(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
EMIT_SOUND(edict(), CHAN_ITEM, "weapons/c4_disarm.wav", VOL_NORM, ATTN_NORM); // Emit sound using bomb.
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
CGrenade *CGrenade::ShootSatchelCharge(entvars_t *pevOwner, Vector vecStart, Vector vecAngles)
|
CGrenade *CGrenade::ShootSatchelCharge(entvars_t *pevOwner, Vector vecStart, Vector vecAngles)
|
||||||
@ -1201,7 +1209,11 @@ void CGrenade::C4Think()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If the timer has expired ! blow this bomb up!
|
// If the timer has expired ! blow this bomb up!
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
if(gpGlobals->time >= m_flC4Blow && (!(m_bStartDefuse && m_pBombDefuser) || gpGlobals->time < m_flDefuseCountDown)) // Prevent exploding after defusing.
|
||||||
|
#else
|
||||||
if (gpGlobals->time >= m_flC4Blow)
|
if (gpGlobals->time >= m_flC4Blow)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
if (TheBots)
|
if (TheBots)
|
||||||
{
|
{
|
||||||
@ -1232,10 +1244,15 @@ void CGrenade::C4Think()
|
|||||||
|
|
||||||
g_pGameRules->m_bBombDropped = FALSE;
|
g_pGameRules->m_bBombDropped = FALSE;
|
||||||
|
|
||||||
|
#ifndef REGAMEDLL_FIXES
|
||||||
if (pev->waterlevel != 0)
|
if (pev->waterlevel != 0)
|
||||||
UTIL_Remove(this);
|
UTIL_Remove(this); // Causes infinite round
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
SetThink(&CGrenade::Detonate2);
|
SetThink(&CGrenade::Detonate2);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the defusing process has started
|
// if the defusing process has started
|
||||||
|
@ -960,7 +960,11 @@ void CBasePlayerWeapon::ItemPostFrame()
|
|||||||
m_fInReload = FALSE;
|
m_fInReload = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((usableButtons & IN_ATTACK2) && CanAttack(m_flNextSecondaryAttack, UTIL_WeaponTimeBase(), UseDecrement()))
|
if ((usableButtons & IN_ATTACK2) && CanAttack(m_flNextSecondaryAttack, UTIL_WeaponTimeBase(), UseDecrement())
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
&& !m_pPlayer->m_bIsDefusing // In-line: I think it's fine to block secondary attack, when defusing. It's better then blocking speed resets in weapons.
|
||||||
|
#endif
|
||||||
|
)
|
||||||
{
|
{
|
||||||
if (pszAmmo2() && !m_pPlayer->m_rgAmmo[SecondaryAmmoIndex()])
|
if (pszAmmo2() && !m_pPlayer->m_rgAmmo[SecondaryAmmoIndex()])
|
||||||
{
|
{
|
||||||
|
@ -72,6 +72,14 @@ BOOL CC4::Deploy()
|
|||||||
void CC4::Holster(int skiplocal)
|
void CC4::Holster(int skiplocal)
|
||||||
{
|
{
|
||||||
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f;
|
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f;
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
if(m_bStartedArming)
|
||||||
|
{
|
||||||
|
m_pPlayer->SetProgressBarTime(0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
m_bStartedArming = false; // stop arming sequence
|
m_bStartedArming = false; // stop arming sequence
|
||||||
|
|
||||||
if (!m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType])
|
if (!m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user