diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-07 19:27:10 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-07 19:27:10 +0300 |
commit | 249d59d10905f46ee91683d08386c7bc9936bc4b (patch) | |
tree | 5ef78f3585320b3e51d0680a68773a26b320081d /src/gui/widgets/window.cpp | |
parent | ef190a13443d1ae9522c98ac5fab5a8c6181cda1 (diff) | |
download | manaverse-249d59d10905f46ee91683d08386c7bc9936bc4b.tar.gz manaverse-249d59d10905f46ee91683d08386c7bc9936bc4b.tar.bz2 manaverse-249d59d10905f46ee91683d08386c7bc9936bc4b.tar.xz manaverse-249d59d10905f46ee91683d08386c7bc9936bc4b.zip |
fix crash in windows before game started.
Diffstat (limited to 'src/gui/widgets/window.cpp')
-rw-r--r-- | src/gui/widgets/window.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index f8622bb20..dd7627b23 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -769,9 +769,22 @@ void Window::mousePressed(MouseEvent &event) if (popupMenu) { event.consume(); - popupMenu->showWindowPopup(this, - viewport->mMouseX, - viewport->mMouseY); + + if (viewport) + { + popupMenu->showWindowPopup(this, + viewport->mMouseX, + viewport->mMouseY); + } + else + { + int mouseX = 0; + int mouseY = 0; + Gui::getMouseState(&mouseX, &mouseY); + popupMenu->showWindowPopup(this, + mouseX, + mouseY); + } } } } |