From 4180d647fdfedca0e2ef64fe8e07cb358b11cbf9 Mon Sep 17 00:00:00 2001 From: cuoco Date: Wed, 28 Aug 2024 13:29:20 +0000 Subject: Fixed choosing default world when using -D command-line parameter - Updated STATE_WORLD_SELECT case to automatically select the first world and proceed to update state when mOptions.chooseDefault is true. - This change ensures that the world selection window is bypassed for a smoother user experience when the default selection option is enabled. - Improved logic to handle cases with only one available world and directly proceed without showing the dialog. --- src/client.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src') diff --git a/src/client.cpp b/src/client.cpp index 6fe64b2a..05e3af01 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -681,7 +681,7 @@ int Client::exec() // Trust that the netcode knows what it's doing mState = STATE_UPDATE; } - else if (worlds.size() == 1) + else if (worlds.size() == 1 || mOptions.chooseDefault) { Net::getLoginHandler()->chooseServer(0); mState = STATE_UPDATE; @@ -689,11 +689,6 @@ int Client::exec() else { mCurrentDialog = new WorldSelectDialog(std::move(worlds)); - if (mOptions.chooseDefault) - { - ((WorldSelectDialog*) mCurrentDialog)->action( - gcn::ActionEvent(nullptr, "ok")); - } } } break; -- cgit v1.2.3-70-g09d2