diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-05-14 03:23:49 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-05-14 03:23:49 +0300 |
commit | eedeca17b9867762093e330d68bf21aea9e75fba (patch) | |
tree | e1acce6753ffedeff5ea4c80dc3399f6dd0260c9 /src/client.cpp | |
parent | 1a04f34a62dc82833dbe994a9f11d543b6a78928 (diff) | |
download | plus-eedeca17b9867762093e330d68bf21aea9e75fba.tar.gz plus-eedeca17b9867762093e330d68bf21aea9e75fba.tar.bz2 plus-eedeca17b9867762093e330d68bf21aea9e75fba.tar.xz plus-eedeca17b9867762093e330d68bf21aea9e75fba.zip |
Add missing checks.
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/client.cpp b/src/client.cpp index 4bd321712..2e44b94b3 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -673,7 +673,8 @@ int Client::exec() while (get_elapsed_time(lastTickTime) > 0) { - gui->logic(); + if (gui) + gui->logic(); if (game) game->logic(); @@ -689,7 +690,8 @@ int Client::exec() if (SDL_GetAppState() & SDL_APPACTIVE) { frame_count++; - gui->draw(); + if (gui) + gui->draw(); graphics->updateScreen(); // logger->log("active"); } @@ -745,8 +747,14 @@ int Client::exec() else if (mOldState == STATE_START || (mOldState == STATE_GAME && mState != STATE_GAME)) { + if (!gui) + break; + gcn::Container *top = static_cast<gcn::Container*>(gui->getTop()); + if (!top) + break; + mDesktop = new Desktop; top->add(mDesktop); mSetupButton = new Button(_("Setup"), "Setup", this); @@ -1635,6 +1643,9 @@ void Client::initScreenshotDir() void Client::accountLogin(LoginData *loginData) { + if (!loginData) + return; + logger->log("Username is %s", loginData->username.c_str()); // Send login infos |