From c35545a5b8dc9886f8583e80fc91e8d7e06d5232 Mon Sep 17 00:00:00 2001 From: s1lent Date: Sat, 21 Sep 2019 18:39:44 +0700 Subject: [PATCH] CGrenade::Use: Fixed spam sound on defuse start, if player in air --- regamedll/dlls/ggrenade.cpp | 17 ++++++++--------- regamedll/dlls/player.cpp | 4 ++-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/regamedll/dlls/ggrenade.cpp b/regamedll/dlls/ggrenade.cpp index e52d7ab5..277e0e8e 100644 --- a/regamedll/dlls/ggrenade.cpp +++ b/regamedll/dlls/ggrenade.cpp @@ -1151,21 +1151,20 @@ void CGrenade::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useTy { #ifdef REGAMEDLL_FIXES if (m_pBombDefuser == pPlayer) +#endif { - if ((pPlayer->pev->flags & FL_ONGROUND) != FL_ONGROUND) // Defuse should start only on ground - { - ClientPrint(pPlayer->pev, HUD_PRINTCENTER, "#C4_Defuse_Must_Be_On_Ground"); - return; - } - m_fNextDefuse = gpGlobals->time + NEXT_DEFUSE_TIME; } -#else - m_fNextDefuse = gpGlobals->time + NEXT_DEFUSE_TIME; -#endif // #ifdef REGAMEDLL_FIXES return; } +#ifdef REGAMEDLL_FIXES + else if ((pPlayer->pev->flags & FL_ONGROUND) != FL_ONGROUND) // Defuse should start only on ground + { + ClientPrint(pPlayer->pev, HUD_PRINTCENTER, "#C4_Defuse_Must_Be_On_Ground"); + return; + } +#endif DefuseBombStart(pPlayer); } diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index 192852ab..c77f72f7 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -1502,8 +1502,8 @@ void CBasePlayer::RemoveAllItems(BOOL removeSuit) m_pTank->Use(this, this, USE_OFF, 0); m_pTank = nullptr; } -#endif - +#endif + if (m_bHasDefuser) { RemoveDefuser();