diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/progs/manaplus/client.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/progs/manaplus/client.cpp b/src/progs/manaplus/client.cpp index d8ba7e1c2..90943812a 100644 --- a/src/progs/manaplus/client.cpp +++ b/src/progs/manaplus/client.cpp @@ -1220,21 +1220,16 @@ int Client::gameExec() // Trust that the netcode knows what it's doing mState = State::UPDATE; } - else if (worlds.size() == 1) + else if (worlds.size() == 1 || settings.options.chooseDefault) { - loginHandler->chooseServer( - 0, mCurrentServer.persistentIp); + // If there is only one world or chooseDefault is true, select the first world + loginHandler->chooseServer(0, mCurrentServer.persistentIp); mState = State::UPDATE; } else { - CREATEWIDGETV(mCurrentDialog, WorldSelectDialog, - worlds); - if (settings.options.chooseDefault) - { - static_cast<WorldSelectDialog*>(mCurrentDialog) - ->action(ActionEvent(nullptr, "ok")); - } + // Otherwise, show the world selection dialog + CREATEWIDGETV(mCurrentDialog, WorldSelectDialog, worlds); } } BLOCK_END("Client::gameExec State::WORLD_SELECT") |