Merge LIFE_BAR and LIFE_BATTERY code paths.
This commit is contained in:
@@ -1164,37 +1164,22 @@ void ScreenGameplay::UpdateCheckFail()
|
|||||||
if( AllAreInDanger() ) m_Background.TurnDangerOn();
|
if( AllAreInDanger() ) m_Background.TurnDangerOn();
|
||||||
else m_Background.TurnDangerOff();
|
else m_Background.TurnDangerOff();
|
||||||
|
|
||||||
int pn;
|
// check for individual fail
|
||||||
switch( GAMESTATE->m_SongOptions.m_LifeType )
|
for ( int pn=0; pn<NUM_PLAYERS; pn++ )
|
||||||
{
|
{
|
||||||
case SongOptions::LIFE_BAR:
|
if( !GAMESTATE->IsPlayerEnabled(pn) )
|
||||||
// check for individual fail
|
continue;
|
||||||
for ( pn=0; pn<NUM_PLAYERS; pn++ )
|
if( (m_pLifeMeter[pn] && !m_pLifeMeter[pn]->IsFailing()) ||
|
||||||
{
|
(m_pCombinedLifeMeter && !m_pCombinedLifeMeter->IsFailing((PlayerNumber)pn)) )
|
||||||
if( !GAMESTATE->IsPlayerEnabled(pn) )
|
continue; /* isn't failing */
|
||||||
continue;
|
if( GAMESTATE->m_CurStageStats.bFailed[pn] )
|
||||||
if( (m_pLifeMeter[pn] && !m_pLifeMeter[pn]->IsFailing()) ||
|
continue; /* failed and is already dead */
|
||||||
(m_pCombinedLifeMeter && !m_pCombinedLifeMeter->IsFailing((PlayerNumber)pn)) )
|
|
||||||
continue; /* isn't failing */
|
LOG->Trace("Player %d failed", (int)pn);
|
||||||
if( GAMESTATE->m_CurStageStats.bFailed[pn] )
|
GAMESTATE->m_CurStageStats.bFailed[pn] = true; // fail
|
||||||
continue; /* already failed */
|
|
||||||
|
|
||||||
LOG->Trace("Player %d failed", (int)pn);
|
if( GAMESTATE->m_SongOptions.m_LifeType == SongOptions::LIFE_BATTERY )
|
||||||
GAMESTATE->m_CurStageStats.bFailed[pn] = true; // fail
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SongOptions::LIFE_BATTERY:
|
|
||||||
// check for individual fail
|
|
||||||
for( pn=0; pn<NUM_PLAYERS; pn++ )
|
|
||||||
{
|
{
|
||||||
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
|
if( !AllFailedEarlier() ) // if not the last one to fail
|
||||||
{
|
{
|
||||||
// kill them!
|
// kill them!
|
||||||
@@ -1203,9 +1188,7 @@ void ScreenGameplay::UpdateCheckFail()
|
|||||||
m_Player[pn].Init(); // remove all notes and scoring
|
m_Player[pn].Init(); // remove all notes and scoring
|
||||||
m_Player[pn].FadeToFail(); // tell the NoteField to fade to white
|
m_Player[pn].FadeToFail(); // tell the NoteField to fade to white
|
||||||
}
|
}
|
||||||
GAMESTATE->m_CurStageStats.bFailed[pn] = true;
|
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user