CGrenade::Use: Fixed spam sound on defuse start, if player in air

This commit is contained in:
s1lent 2019-09-21 18:39:44 +07:00
parent 22f5fe3831
commit c35545a5b8
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C
2 changed files with 10 additions and 11 deletions

View File

@ -1151,21 +1151,20 @@ void CGrenade::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useTy
{ {
#ifdef REGAMEDLL_FIXES #ifdef REGAMEDLL_FIXES
if (m_pBombDefuser == pPlayer) if (m_pBombDefuser == pPlayer)
#endif
{ {
if ((pPlayer->pev->flags & FL_ONGROUND) != FL_ONGROUND) // Defuse should start only on ground m_fNextDefuse = gpGlobals->time + NEXT_DEFUSE_TIME;
}
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"); ClientPrint(pPlayer->pev, HUD_PRINTCENTER, "#C4_Defuse_Must_Be_On_Ground");
return; return;
} }
#endif
m_fNextDefuse = gpGlobals->time + NEXT_DEFUSE_TIME;
}
#else
m_fNextDefuse = gpGlobals->time + NEXT_DEFUSE_TIME;
#endif // #ifdef REGAMEDLL_FIXES
return;
}
DefuseBombStart(pPlayer); DefuseBombStart(pPlayer);
} }