Skip to content

Commit

Permalink
CGrenade::Use: Fixed spam sound on defuse start, if player in air
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lentq committed Sep 21, 2019
1 parent 22f5fe3 commit c35545a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
17 changes: 8 additions & 9 deletions regamedll/dlls/ggrenade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions regamedll/dlls/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit c35545a

Please sign in to comment.