summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-25 21:36:35 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-25 21:36:35 +0300
commit760b544fb26dcfc5103a44bf977cd8cd95b0862a (patch)
treed187c52aee57d51045df6b8756693e7a613dc09e /src
parent6ea2440a8662c4ffae8f7b6b53e84ddd25d69971 (diff)
downloadmv-760b544fb26dcfc5103a44bf977cd8cd95b0862a.tar.gz
mv-760b544fb26dcfc5103a44bf977cd8cd95b0862a.tar.bz2
mv-760b544fb26dcfc5103a44bf977cd8cd95b0862a.tar.xz
mv-760b544fb26dcfc5103a44bf977cd8cd95b0862a.zip
Move state handler STATE_SWITCH_LOGIN into separate function.
Diffstat (limited to 'src')
-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;