fix crash going from gameplay to how to play with delayed screen loads off

This commit is contained in:
Glenn Maynard
2004-02-16 05:30:31 +00:00
parent 47bf1ef190
commit b665a81749
3 changed files with 17 additions and 1 deletions
+7
View File
@@ -1146,8 +1146,15 @@ void ScreenGameplay::Update( float fDeltaTime )
else
Screen::Update( fDeltaTime );
/* This happens if ScreenDemonstration::HandleScreenMessage sets a new screen when
* PREFSMAN->m_bDelayedScreenLoad. */
if( GAMESTATE->m_pCurSong == NULL )
return;
/* This can happen if ScreenDemonstration::HandleScreenMessage sets a new screen when
* !PREFSMAN->m_bDelayedScreenLoad. (The new screen was loaded when we called Screen::Update,
* and the ctor might set a new GAMESTATE->m_pCurSong, so the above check can fail.) */
if( SCREENMAN->GetTopScreen() != this )
return;
if( GAMESTATE->m_MasterPlayerNumber != PLAYER_INVALID )
m_MaxCombo.SetText( ssprintf("%d", g_CurStageStats.iMaxCombo[GAMESTATE->m_MasterPlayerNumber]) ); /* MAKE THIS WORK FOR BOTH PLAYERS! */