summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorcuoco <atunna2026@gmail.com>2024-08-28 13:29:20 +0000
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-08-28 13:29:20 +0000
commit4180d647fdfedca0e2ef64fe8e07cb358b11cbf9 (patch)
tree82b9d220d38c21f900fc891018fb8061dcb68d6b /src/client.cpp
parentd908f9c55c17700ee5b8cd44c6939a465d6f6f92 (diff)
downloadmana-master.tar.gz
mana-master.tar.bz2
mana-master.tar.xz
mana-master.zip
Fixed choosing default world when using -D command-line parameterHEADmaster
- 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.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp7
1 files changed, 1 insertions, 6 deletions
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;