summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-08-09 00:27:33 +0300
committerAndrei Karas <akaras@inbox.ru>2015-08-09 00:27:33 +0300
commit2fa941b89177cf91cbbc84700c1d7631aa85bcc2 (patch)
treeebc3464db530afd540a67bb86ea735624841ec32 /src/game.cpp
parentb4ec726fe28f65b15fd4cc7b0ef6fd72b7d24c02 (diff)
downloadplus-2fa941b89177cf91cbbc84700c1d7631aa85bcc2.tar.gz
plus-2fa941b89177cf91cbbc84700c1d7631aa85bcc2.tar.bz2
plus-2fa941b89177cf91cbbc84700c1d7631aa85bcc2.tar.xz
plus-2fa941b89177cf91cbbc84700c1d7631aa85bcc2.zip
Add some missing checks to other files found by paranucker.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/game.cpp b/src/game.cpp
index b5e492ee5..0d239fa3e 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -153,12 +153,13 @@ static void initEngines()
#endif
crazyMoves = new CrazyMoves;
- particleEngine = new Particle();
+ particleEngine = new Particle;
particleEngine->setMap(nullptr);
particleEngine->setupEngine();
BeingInfo::init();
- gameHandler->initEngines();
+ if (gameHandler)
+ gameHandler->initEngines();
keyboard.update();
if (joystick)
@@ -195,7 +196,7 @@ static void createGuiWindows()
CREATEWIDGETV(inventoryWindow, InventoryWindow,
PlayerInfo::getInventory());
#ifdef EATHENA_SUPPORT
- if (serverFeatures->haveCart())
+ if (serverFeatures && serverFeatures->haveCart())
{
CREATEWIDGETV(cartWindow, InventoryWindow,
PlayerInfo::getCartInventory());
@@ -285,7 +286,8 @@ static void createGuiWindows()
if (localPlayer)
localPlayer->updateStatus();
- generalHandler->gameStarted();
+ if (generalHandler)
+ generalHandler->gameStarted();
}
/**
@@ -293,7 +295,8 @@ static void createGuiWindows()
*/
static void destroyGuiWindows()
{
- generalHandler->gameEnded();
+ if (generalHandler)
+ generalHandler->gameEnded();
if (whoIsOnline)
whoIsOnline->setAllowUpdate(false);