From 2fa941b89177cf91cbbc84700c1d7631aa85bcc2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 9 Aug 2015 00:27:33 +0300 Subject: Add some missing checks to other files found by paranucker. --- src/game.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/game.cpp') 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); -- cgit v1.2.3-60-g2f50