remove multiplayer song index hack, replace with UpdateStageStats override that multiplayer can use

fix gameplay fails immediately if all players don't have a LifeMeter.
This commit is contained in:
Chris Danford
2007-08-24 20:29:01 +00:00
parent 1bdf0c8bcf
commit bd9447ede4
2 changed files with 8 additions and 4 deletions
+6 -4
View File
@@ -993,16 +993,18 @@ void ScreenGameplay::LoadNextSong()
{ {
GAMESTATE->ResetMusicStatistics(); GAMESTATE->ResetMusicStatistics();
FOREACH_EnabledPlayerInfoNotDummy( m_vPlayerInfo, pi ) FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi )
{ {
pi->GetPlayerStageStats()->m_iSongsPlayed++; pi->GetPlayerStageStats()->m_iSongsPlayed++;
if( pi->m_ptextCourseSongNumber ) if( pi->m_ptextCourseSongNumber )
pi->m_ptextCourseSongNumber->SetText( ssprintf("%d", pi->GetPlayerStageStats()->m_iSongsPassed+1) ); pi->m_ptextCourseSongNumber->SetText( ssprintf("%d", pi->GetPlayerStageStats()->m_iSongsPassed+1) );
} }
// super hack
if( GAMESTATE->m_bMultiplayer ) if( GAMESTATE->m_bMultiplayer )
STATSMAN->m_CurStageStats.m_player[GAMESTATE->m_MasterPlayerNumber].m_iSongsPlayed++; {
FOREACH_ENUM( MultiPlayer, mp )
this->UpdateStageStats( mp );
}
int iPlaySongIndex = GAMESTATE->GetCourseSongIndex(); int iPlaySongIndex = GAMESTATE->GetCourseSongIndex();
iPlaySongIndex %= m_apSongsQueue.size(); iPlaySongIndex %= m_apSongsQueue.size();
@@ -1615,7 +1617,7 @@ void ScreenGameplay::Update( float fDeltaTime )
switch( ft ) switch( ft )
{ {
case PlayerOptions::FAIL_IMMEDIATE: case PlayerOptions::FAIL_IMMEDIATE:
if( pi->m_pLifeMeter && !pi->m_pLifeMeter->IsFailing() ) if( pi->m_pLifeMeter == NULL || (pi->m_pLifeMeter && !pi->m_pLifeMeter->IsFailing()) )
bAllFailed = false; bAllFailed = false;
break; break;
case PlayerOptions::FAIL_IMMEDIATE_CONTINUE: case PlayerOptions::FAIL_IMMEDIATE_CONTINUE:
+2
View File
@@ -130,6 +130,8 @@ public:
PlayerInfo *GetPlayerInfo( PlayerNumber pn ); PlayerInfo *GetPlayerInfo( PlayerNumber pn );
protected: protected:
virtual void UpdateStageStats( MultiPlayer mp ) {}; // overridden for multiplayer
virtual bool GenericTweenOn() const { return true; } virtual bool GenericTweenOn() const { return true; }
virtual bool GenericTweenOff() const { return true; } virtual bool GenericTweenOff() const { return true; }