summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp15
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