summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client.cpp14
-rw-r--r--src/client.h2
2 files changed, 13 insertions, 3 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 8358468fc..02626dcd4 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -775,6 +775,15 @@ void Client::stateConnectServer1()
}
}
+void Client::stateWorldSelect1()
+{
+ if (mOldState == STATE_UPDATE)
+ {
+ if (loginHandler->getWorlds().size() < 2)
+ mState = STATE_PRE_LOGIN;
+ }
+}
+
int Client::gameExec()
{
int lastTickTime = tick_time;
@@ -845,10 +854,9 @@ int Client::gameExec()
{
stateConnectServer1();
}
- else if (mState == STATE_WORLD_SELECT && mOldState == STATE_UPDATE)
+ else if (mState == STATE_WORLD_SELECT)
{
- if (loginHandler->getWorlds().size() < 2)
- mState = STATE_PRE_LOGIN;
+ stateWorldSelect1();
}
else if (mOldState == STATE_START ||
(mOldState == STATE_GAME && mState != STATE_GAME))
diff --git a/src/client.h b/src/client.h
index d3edf82e2..a1fea903d 100644
--- a/src/client.h
+++ b/src/client.h
@@ -116,6 +116,8 @@ class Client final : public ConfigListener,
void stateConnectServer1();
+ void stateWorldSelect1();
+
ServerInfo mCurrentServer;
Game *mGame;