summaryrefslogtreecommitdiff
path: root/src/client.cpp
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/client.cpp
parent6ea2440a8662c4ffae8f7b6b53e84ddd25d69971 (diff)
downloadplus-760b544fb26dcfc5103a44bf977cd8cd95b0862a.tar.gz
plus-760b544fb26dcfc5103a44bf977cd8cd95b0862a.tar.bz2
plus-760b544fb26dcfc5103a44bf977cd8cd95b0862a.tar.xz
plus-760b544fb26dcfc5103a44bf977cd8cd95b0862a.zip
Move state handler STATE_SWITCH_LOGIN into separate function.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp13
1 files changed, 10 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")