summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client.cpp13
-rw-r--r--src/client.h2
2 files changed, 12 insertions, 3 deletions
diff --git a/src/client.cpp b/src/client.cpp
index f5fba647e..977336650 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -825,6 +825,12 @@ void Client::stateGame1()
mainGraphics->getHeight());
}
+void Client::stateSwitchLogin1()
+{
+ if (mOldState == STATE_GAME)
+ gameHandler->disconnect();
+}
+
int Client::gameExec()
{
int lastTickTime = tick_time;
@@ -904,11 +910,12 @@ int Client::gameExec()
{
stateGame1();
}
+ else if (mState == STATE_SWITCH_LOGIN)
+ {
+ stateSwitchLogin1();
+ }
BLOCK_END("Client::gameExec 6")
- if (mState == STATE_SWITCH_LOGIN && mOldState == STATE_GAME)
- gameHandler->disconnect();
-
if (mState != mOldState)
{
BLOCK_START("Client::gameExec 7")
diff --git a/src/client.h b/src/client.h
index 8c36ec888..089ac06a3 100644
--- a/src/client.h
+++ b/src/client.h
@@ -120,6 +120,8 @@ class Client final : public ConfigListener,
void stateGame1();
+ void stateSwitchLogin1();
+
ServerInfo mCurrentServer;
Game *mGame;