From dfe930eea911be16cef9eb9397986c32ad1cfcc7 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Sun, 1 Apr 2007 12:05:20 +0000 Subject: [PATCH] Fix a crash with SDemo by using the current style if it is set. --- stepmania/src/GameState.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index dbb9a0bc27..02a9eeb38c 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -585,7 +585,9 @@ int GameState::GetNumStagesForCurrentSongAndStepsOrCourse() const Style *pStyle = vpStyles[0]; st = pStyle->m_StepsType; } - const Style *pStyle = GAMEMAN->GetFirstCompatibleStyle( GAMESTATE->m_pCurGame, GAMESTATE->GetNumSidesJoined(), st ); + const Style *pStyle = GAMESTATE->m_pCurStyle; + if( pStyle == NULL ) + pStyle = GAMEMAN->GetFirstCompatibleStyle( GAMESTATE->m_pCurGame, GAMESTATE->GetNumSidesJoined(), st ); iNumStagesOfThisSong = GameState::GetNumStagesForSongAndStyleType( GAMESTATE->m_pCurSong, pStyle->m_StyleType ); } else if( GAMESTATE->m_pCurCourse )