Fix bot respawn

This commit is contained in:
mittorn 2017-01-10 18:55:51 +00:00
parent 70c633706a
commit 8fb9b07720
2 changed files with 5 additions and 2 deletions

View File

@ -164,6 +164,9 @@ void CHLBot::Killed(entvars_t *pevAttacker, int iGib)
// extend
CBasePlayer::Killed(pevAttacker, iGib);
ClearMovement();
//respawn( pev, !( m_afPhysicsFlags & PFLAG_OBSERVER ) );
}
// Return true if line segment intersects rectagular volume

View File

@ -1279,7 +1279,7 @@ void CBasePlayer::PlayerDeathThink( void )
// wait for all buttons released
if( pev->deadflag == DEAD_DEAD )
{
if( fAnyButtonDown )
if( !IsBot() && fAnyButtonDown )
return;
if( g_pGameRules->FPlayerCanRespawn( this ) )
@ -1301,7 +1301,7 @@ void CBasePlayer::PlayerDeathThink( void )
}
// wait for any button down, or mp_forcerespawn is set and the respawn time is up
if( !fAnyButtonDown && !( g_pGameRules->IsMultiplayer() && forcerespawn.value > 0 && ( gpGlobals->time > ( m_fDeadTime + 5 ) ) ) )
if( !fAnyButtonDown && !( g_pGameRules->IsMultiplayer() && ( IsBot() || forcerespawn.value ) && ( gpGlobals->time > ( m_fDeadTime + 5 ) ) ) )
return;
pev->button = 0;