From f19f7674fc95aa73134cfc23a078ab928d9e563b Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 16 Sep 2003 01:25:34 +0000 Subject: [PATCH] Merge LIFE_BAR and LIFE_BATTERY code paths. --- stepmania/src/ScreenGameplay.cpp | 43 ++++++++++---------------------- 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 4a8673ad79..ad8d23e935 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -1164,37 +1164,22 @@ void ScreenGameplay::UpdateCheckFail() if( AllAreInDanger() ) m_Background.TurnDangerOn(); else m_Background.TurnDangerOff(); - int pn; - switch( GAMESTATE->m_SongOptions.m_LifeType ) + // check for individual fail + for ( int pn=0; pnIsPlayerEnabled(pn) ) - continue; - if( (m_pLifeMeter[pn] && !m_pLifeMeter[pn]->IsFailing()) || - (m_pCombinedLifeMeter && !m_pCombinedLifeMeter->IsFailing((PlayerNumber)pn)) ) - continue; /* isn't failing */ - if( GAMESTATE->m_CurStageStats.bFailed[pn] ) - continue; /* already failed */ + if( !GAMESTATE->IsPlayerEnabled(pn) ) + continue; + if( (m_pLifeMeter[pn] && !m_pLifeMeter[pn]->IsFailing()) || + (m_pCombinedLifeMeter && !m_pCombinedLifeMeter->IsFailing((PlayerNumber)pn)) ) + continue; /* isn't failing */ + if( GAMESTATE->m_CurStageStats.bFailed[pn] ) + continue; /* failed and is already dead */ + + LOG->Trace("Player %d failed", (int)pn); + GAMESTATE->m_CurStageStats.bFailed[pn] = true; // fail - LOG->Trace("Player %d failed", (int)pn); - GAMESTATE->m_CurStageStats.bFailed[pn] = true; // fail - } - break; - case SongOptions::LIFE_BATTERY: - // check for individual fail - for( pn=0; pnm_SongOptions.m_LifeType == SongOptions::LIFE_BATTERY ) { - if( !GAMESTATE->IsPlayerEnabled(pn) ) - continue; - if( (m_pLifeMeter[pn] && !m_pLifeMeter[pn]->IsFailing()) || - (m_pCombinedLifeMeter && !m_pCombinedLifeMeter->IsFailing((PlayerNumber)pn)) ) - continue; /* isn't failing */ - if( GAMESTATE->m_CurStageStats.bFailed[pn] ) - continue; /* failed and is already dead */ - if( !AllFailedEarlier() ) // if not the last one to fail { // kill them! @@ -1203,9 +1188,7 @@ void ScreenGameplay::UpdateCheckFail() m_Player[pn].Init(); // remove all notes and scoring m_Player[pn].FadeToFail(); // tell the NoteField to fade to white } - GAMESTATE->m_CurStageStats.bFailed[pn] = true; } - break; } }