fix default game selection

This commit is contained in:
Glenn Maynard
2007-02-08 21:21:17 +00:00
parent 2aca7a4d16
commit ff420be0eb
2 changed files with 15 additions and 4 deletions
+14 -1
View File
@@ -2353,7 +2353,20 @@ void GameManager::GetEnabledGames( vector<const Game*>& aGamesOut ) const
const Game* GameManager::GetDefaultGame() const
{
return g_Games[0];
const Game *pDefault = NULL;
if( pDefault == NULL )
{
for( size_t i=0; pDefault == NULL && i < ARRAYSIZE(g_Games); ++i )
{
if( IsGameEnabled(g_Games[i]) )
pDefault = g_Games[i];
}
if( pDefault == NULL )
RageException::Throw( "No NoteSkins found" );
}
return pDefault;
}
int GameManager::GetIndexFromGame( const Game* pGame ) const
+1 -3
View File
@@ -766,9 +766,7 @@ static void SwitchToLastPlayedGame()
pGame->m_szName, GAMEMAN->GetDefaultGame()->m_szName );
}
/* If the default isn't available, our default note skin is messed up. */
if( !GAMEMAN->IsGameEnabled(pGame) )
RageException::Throw( "Default NoteSkin for \"%s\" missing", pGame->m_szName );
ASSERT( GAMEMAN->IsGameEnabled(pGame) );
StepMania::ChangeCurrentGame( pGame );
}