Fix regression with command line --go option
authorCraig Robbins <kde.psych@gmail.com>
Fri, 28 Nov 2014 12:29:34 +0000 (22:29 +1000)
committerCraig Robbins <kde.psych@gmail.com>
Fri, 28 Nov 2014 12:48:46 +0000 (22:48 +1000)
src/main.cpp

index 23ce01073bd745a925a8c34c1c74d47f5863dfe4..2ebdeda205f2516364d50e08d20e850f36112868 100644 (file)
@@ -1818,8 +1818,17 @@ bool ClientLauncher::run(GameParams &game_params, const Settings &cmd_args)
 
 void ClientLauncher::init_args(GameParams &game_params, const Settings &cmd_args)
 {
+
+       skip_main_menu = cmd_args.getFlag("go");
+
+       // FIXME: This is confusing (but correct)
+
+       /* If world_path is set then override it unless skipping the main menu using
+        * the --go command line param. Else, give preference to the address
+        * supplied on the command line
+        */
        address = g_settings->get("address");
-       if (game_params.world_path != "")
+       if (game_params.world_path != "" && !skip_main_menu)
                address = "";
        else if (cmd_args.exists("address"))
                address = cmd_args.get("address");
@@ -1828,8 +1837,6 @@ void ClientLauncher::init_args(GameParams &game_params, const Settings &cmd_args
        if (cmd_args.exists("name"))
                playername = cmd_args.get("name");
 
-       skip_main_menu = cmd_args.getFlag("go");
-
        list_video_modes = cmd_args.getFlag("videomodes");
 
        use_freetype = g_settings->getBool("freetype");