if FAIL_OFF, don't set DANGER or DEAD. This means

GameState::AllAreInDangerOrWorse is always false in FAIL_OFF; if
emptying the lifebar doesn't fail you, you're not in danger from it.
This commit is contained in:
Glenn Maynard
2006-11-09 06:26:28 +00:00
parent f56a2ba7df
commit 31534db436
2 changed files with 4 additions and 6 deletions
-4
View File
@@ -1740,15 +1740,11 @@ Premium GameState::GetPremium() const
bool GameState::IsPlayerInDanger( const PlayerState *pPlayerState ) const
{
if( GetPlayerFailType(pPlayerState) == SongOptions::FAIL_OFF )
return false;
return pPlayerState->m_HealthState == PlayerState::DANGER;
}
bool GameState::IsPlayerDead( const PlayerState *pPlayerState ) const
{
if( GetPlayerFailType(pPlayerState) == SongOptions::FAIL_OFF )
return false;
return pPlayerState->m_HealthState == PlayerState::DEAD;
}
+4 -2
View File
@@ -1572,7 +1572,8 @@ void ScreenGameplay::Update( float fDeltaTime )
//
FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi )
{
if( pi->m_pLifeMeter && pi->m_pLifeMeter->IsFailing() )
if( GAMESTATE->GetPlayerFailType(pi->GetPlayerState()) != SongOptions::FAIL_OFF &&
pi->m_pLifeMeter && pi->m_pLifeMeter->IsFailing() )
{
pi->GetPlayerState()->m_HealthState = PlayerState::DEAD;
}
@@ -1580,7 +1581,8 @@ void ScreenGameplay::Update( float fDeltaTime )
{
pi->GetPlayerState()->m_HealthState = PlayerState::HOT;
}
else if( pi->m_pLifeMeter && pi->m_pLifeMeter->IsInDanger() )
else if( GAMESTATE->GetPlayerFailType(pi->GetPlayerState()) != SongOptions::FAIL_OFF &&
pi->m_pLifeMeter && pi->m_pLifeMeter->IsInDanger() )
{
pi->GetPlayerState()->m_HealthState = PlayerState::DANGER;
}