summaryrefslogtreecommitdiff
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
parentd908f9c55c17700ee5b8cd44c6939a465d6f6f92 (diff)
downloadmana-4180d647fdfedca0e2ef64fe8e07cb358b11cbf9.tar.gz
mana-4180d647fdfedca0e2ef64fe8e07cb358b11cbf9.tar.bz2
mana-4180d647fdfedca0e2ef64fe8e07cb358b11cbf9.tar.xz
mana-4180d647fdfedca0e2ef64fe8e07cb358b11cbf9.zip
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.
-rw-r--r--NEWS1
-rw-r--r--src/client.cpp7
2 files changed, 2 insertions, 6 deletions
diff --git a/NEWS b/NEWS
index 8fd26965..3adad045 100644
--- a/NEWS
+++ b/NEWS
@@ -46,6 +46,7 @@
- Fixed item links with empty item name to look up name from Item DB
- Fixed spaces getting added to chat every 50 characters
- Fixed empty Equipment window on freshly created character
+- Fixed choosing default world when using -D command-line parameter
- Updated to tmwAthena protocol changes
- Updated to Manaserv protocol changes (specials, guilds, debug mode, skills, text particles)
- CMake: Use GNUInstallDirs and made PKG_DATADIR / PKG_BINDIR paths modifiable
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;