diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-08-07 02:23:04 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-08-07 02:23:04 +0300 |
commit | 3e0bce53e2b3387801f3e0484f01a64d767115da (patch) | |
tree | 0601c1a09f7452fb41702249e70cbe0f035ea7df /src/gui/widgets/tabs | |
parent | c35ae089aaa484b72c787625d2dd9a1481fa15b6 (diff) | |
download | plus-3e0bce53e2b3387801f3e0484f01a64d767115da.tar.gz plus-3e0bce53e2b3387801f3e0484f01a64d767115da.tar.bz2 plus-3e0bce53e2b3387801f3e0484f01a64d767115da.tar.xz plus-3e0bce53e2b3387801f3e0484f01a64d767115da.zip |
Allow open debug window before connecting to game.
Diffstat (limited to 'src/gui/widgets/tabs')
-rw-r--r-- | src/gui/widgets/tabs/debugwindowtabs.cpp | 6 |
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()) |