summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-25 16:51:44 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-25 16:51:44 +0300
commitcc5500b642f1cc5e16a44213c9b7423f8210ec66 (patch)
tree940d2d39b1ca80cfd66f572a3934dd011c4880be /src/client.cpp
parent1608d342c064f79b239e4671da516d270445b385 (diff)
downloadplus-cc5500b642f1cc5e16a44213c9b7423f8210ec66.tar.gz
plus-cc5500b642f1cc5e16a44213c9b7423f8210ec66.tar.bz2
plus-cc5500b642f1cc5e16a44213c9b7423f8210ec66.tar.xz
plus-cc5500b642f1cc5e16a44213c9b7423f8210ec66.zip
Move state handler STATE_CONNECT_GAME into separate function.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 5bd3bd163..598c95cc0 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -697,6 +697,12 @@ int Client::testsExec()
top->add(var);
+void Client::stateConnectGame1()
+{
+ if (gameHandler->isConnected())
+ loginHandler->disconnect();
+}
+
int Client::gameExec()
{
int lastTickTime = tick_time;
@@ -759,10 +765,9 @@ int Client::gameExec()
BLOCK_END("~Client::SDL_framerateDelay")
BLOCK_START("Client::gameExec 6")
- if (mState == STATE_CONNECT_GAME &&
- gameHandler->isConnected())
+ if (mState == STATE_CONNECT_GAME)
{
- loginHandler->disconnect();
+ stateConnectGame1();
}
else if (mState == STATE_CONNECT_SERVER &&
mOldState == STATE_CHOOSE_SERVER)