summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-08-07 02:23:04 +0300
committerAndrei Karas <akaras@inbox.ru>2017-08-07 02:23:04 +0300
commit3e0bce53e2b3387801f3e0484f01a64d767115da (patch)
tree0601c1a09f7452fb41702249e70cbe0f035ea7df /src/gui/widgets
parentc35ae089aaa484b72c787625d2dd9a1481fa15b6 (diff)
downloadmanaverse-3e0bce53e2b3387801f3e0484f01a64d767115da.tar.gz
manaverse-3e0bce53e2b3387801f3e0484f01a64d767115da.tar.bz2
manaverse-3e0bce53e2b3387801f3e0484f01a64d767115da.tar.xz
manaverse-3e0bce53e2b3387801f3e0484f01a64d767115da.zip
Allow open debug window before connecting to game.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/tabs/debugwindowtabs.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/widgets/tabs/debugwindowtabs.cpp b/src/gui/widgets/tabs/debugwindowtabs.cpp
index 4a600d2fd..321c3bcad 100644
--- a/src/gui/widgets/tabs/debugwindowtabs.cpp
+++ b/src/gui/widgets/tabs/debugwindowtabs.cpp
@@ -183,8 +183,10 @@ void MapDebugTab::logic()
mXYLabel->setCaption(strprintf("%s (?, ?)", _("Player Position:")));
}
- const Map *const map = Game::instance()->getCurrentMap();
- if ((map != nullptr) && (viewport != nullptr))
+ Game *const game = Game::instance();
+ const Map *const map = game != nullptr ? game->getCurrentMap() : nullptr;
+ if (map != nullptr &&
+ viewport != nullptr)
{
// Get the current mouse position
const int mouseTileX = (viewport->mMouseX + viewport->getCameraX())