Fix mp_forcerespawn (#160)

This commit is contained in:
In-line 2017-06-10 16:36:13 +04:00 committed by Dmitry Novikov
parent 2f599d21b8
commit 2026a64ccc

View File

@ -3679,7 +3679,7 @@ void CBasePlayer::PlayerDeathThink()
if (pev->deadflag == DEAD_RESPAWNABLE) if (pev->deadflag == DEAD_RESPAWNABLE)
{ {
#ifdef REGAMEDLL_FIXES #ifdef REGAMEDLL_FIXES
if (IsObserver() && (m_afPhysicsFlags & PFLAG_OBSERVER) && (m_iTeam == UNASSIGNED || m_iTeam == SPECTATOR)) if (IsObserver() && (m_iTeam == UNASSIGNED || m_iTeam == SPECTATOR))
return; return;
// Player cannot respawn while in the Choose Appearance menu // Player cannot respawn while in the Choose Appearance menu
@ -9742,7 +9742,7 @@ bool EXT_FUNC CBasePlayer::__API_HOOK(GetIntoGame)()
void CBasePlayer::PlayerRespawnThink() void CBasePlayer::PlayerRespawnThink()
{ {
#ifdef REGAMEDLL_ADD #ifdef REGAMEDLL_ADD
if (IsObserver() && (m_afPhysicsFlags & PFLAG_OBSERVER) && (m_iTeam == UNASSIGNED || m_iTeam == SPECTATOR)) if (IsObserver() && (m_iTeam == UNASSIGNED || m_iTeam == SPECTATOR))
return; return;
// Player cannot respawn while in the Choose Appearance menu // Player cannot respawn while in the Choose Appearance menu
@ -9752,7 +9752,7 @@ void CBasePlayer::PlayerRespawnThink()
if (pev->deadflag < DEAD_DYING) if (pev->deadflag < DEAD_DYING)
return; return;
if (forcerespawn.value && gpGlobals->time > (CSPlayer()->m_flRespawnPending + forcerespawn.value)) if (forcerespawn.value > 0 && gpGlobals->time > (CSPlayer()->m_flRespawnPending + forcerespawn.value))
{ {
Spawn(); Spawn();
pev->button = 0; pev->button = 0;