From 36d94f272f26b75e7d4a2f1dc0a297d01d6ae487 Mon Sep 17 00:00:00 2001 From: Kyzentun Date: Mon, 8 Dec 2014 16:39:01 -0700 Subject: [PATCH] Fixed --game command line arg to set the current game correctly soe that the correct input mapping is loaded. --- src/StepMania.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/StepMania.cpp b/src/StepMania.cpp index a4085e9b6e..eadf38dc42 100644 --- a/src/StepMania.cpp +++ b/src/StepMania.cpp @@ -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 ) {