Fixed --game command line arg to set the current game correctly soe that the correct input mapping is loaded.

This commit is contained in:
Kyzentun
2014-12-08 16:39:01 -07:00
parent 780c05e3f2
commit 36d94f272f
+15 -8
View File
@@ -826,19 +826,26 @@ void StepMania::InitializeCurrentGame( const Game* g )
if( sAnnouncer.empty() )
sAnnouncer = GAMESTATE->GetCurrentGame()->m_szName;
RString argCurGame;
if( GetCommandlineArgument( "game", &argCurGame) && argCurGame != sGametype )
{
Game const* new_game= GAMEMAN->StringToGame(argCurGame);
if(new_game == NULL)
{
LOG->Warn("%s is not a known game type, ignoring.", argCurGame.c_str());
}
else
{
PREFSMAN->SetCurrentGame(sGametype);
GAMESTATE->SetCurGame(new_game);
}
}
// It doesn't matter if sTheme is blank or invalid, THEME->STAL will set
// a selectable theme for us. -Kyz
// process gametype, theme and language command line arguments;
// these change the preferences in order for transparent loading -aj
RString argCurGame;
if( GetCommandlineArgument( "game", &argCurGame) && argCurGame != sGametype )
{
sGametype = argCurGame;
// set game type in preferences too for correct behavior
PREFSMAN->SetCurrentGame( sGametype );
}
RString argTheme;
if( GetCommandlineArgument( "theme",&argTheme) && argTheme != sTheme )
{