mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-27 07:05:38 +03:00
Forcerespawn fix (#623)
* Dead players now respawn after enabling the mp_forcerespawn * use timer instead of instant spawn
This commit is contained in:
parent
517f68af93
commit
548cca5e5f
@ -10053,18 +10053,30 @@ void CBasePlayer::PlayerRespawnThink()
|
|||||||
if (pev->deadflag < DEAD_DYING)
|
if (pev->deadflag < DEAD_DYING)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (CSPlayer()->m_flRespawnPending > 0 &&
|
if (CSPlayer()->m_flRespawnPending > 0)
|
||||||
CSPlayer()->m_flRespawnPending <= gpGlobals->time)
|
|
||||||
{
|
{
|
||||||
// Pending respawn caused by game doesn't respawn with disabled CVar
|
if (CSPlayer()->m_flRespawnPending <= gpGlobals->time)
|
||||||
if (CSPlayer()->m_bGameForcingRespawn && !forcerespawn.value)
|
{
|
||||||
return;
|
// Pending respawn caused by game doesn't respawn with disabled CVar
|
||||||
|
if (CSPlayer()->m_bGameForcingRespawn && !forcerespawn.value)
|
||||||
|
{
|
||||||
|
CSPlayer()->m_flRespawnPending = 0.0f;
|
||||||
|
CSPlayer()->m_bGameForcingRespawn = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Spawn();
|
Spawn();
|
||||||
pev->button = 0;
|
pev->button = 0;
|
||||||
pev->nextthink = -1;
|
pev->nextthink = -1;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else if (pev->deadflag == DEAD_DEAD && forcerespawn.value > 0)
|
||||||
|
{
|
||||||
|
CSPlayer()->m_bGameForcingRespawn = true;
|
||||||
|
CSPlayer()->m_flRespawnPending = gpGlobals->time + forcerespawn.value;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user