mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-28 22:48:02 +03:00
Grenade::Use: Move #C4_Defuse_Must_Be_On_Ground to beginning of defusing.
This commit is contained in:
parent
bed4180d03
commit
22f5fe3831
@ -1136,28 +1136,34 @@ void CGrenade::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useTy
|
|||||||
// TODO: We must be sure that the activator is a player.
|
// TODO: We must be sure that the activator is a player.
|
||||||
CBasePlayer *pPlayer = GetClassPtr<CCSPlayer>((CBasePlayer *)pActivator->pev);
|
CBasePlayer *pPlayer = GetClassPtr<CCSPlayer>((CBasePlayer *)pActivator->pev);
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
if (!pPlayer->IsPlayer())
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
// For CTs to defuse the c4
|
// For CTs to defuse the c4
|
||||||
if (pPlayer->m_iTeam != CT)
|
if (pPlayer->m_iTeam != CT)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef REGAMEDLL_FIXES
|
|
||||||
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
|
|
||||||
|
|
||||||
if (m_bStartDefuse)
|
if (m_bStartDefuse)
|
||||||
{
|
{
|
||||||
#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
|
||||||
|
{
|
||||||
|
ClientPrint(pPlayer->pev, HUD_PRINTCENTER, "#C4_Defuse_Must_Be_On_Ground");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
m_fNextDefuse = gpGlobals->time + NEXT_DEFUSE_TIME;
|
m_fNextDefuse = gpGlobals->time + NEXT_DEFUSE_TIME;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
m_fNextDefuse = gpGlobals->time + NEXT_DEFUSE_TIME;
|
||||||
|
#endif // #ifdef REGAMEDLL_FIXES
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1384,7 +1390,7 @@ void CGrenade::C4Think()
|
|||||||
|
|
||||||
// If the timer has expired ! blow this bomb up!
|
// If the timer has expired ! blow this bomb up!
|
||||||
#ifdef REGAMEDLL_FIXES
|
#ifdef REGAMEDLL_FIXES
|
||||||
if(gpGlobals->time >= m_flC4Blow && (!(m_bStartDefuse && m_pBombDefuser) || gpGlobals->time < m_flDefuseCountDown)) // Prevent exploding after defusing.
|
if (gpGlobals->time >= m_flC4Blow && (!(m_bStartDefuse && m_pBombDefuser) || gpGlobals->time < m_flDefuseCountDown)) // Prevent exploding after defusing.
|
||||||
#else
|
#else
|
||||||
if (gpGlobals->time >= m_flC4Blow)
|
if (gpGlobals->time >= m_flC4Blow)
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user