From 57253026ddfa8acdca3a6b8d82c9e803f35655ec Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 26 Jan 2016 17:16:06 +0300 Subject: Not allow walking by mouse if npc dialog is opened. --- src/gui/viewport.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 8d9e33ada..8f2940824 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -514,7 +514,6 @@ void Viewport::mousePressed(MouseEvent &event) if (event.getSource() != this || event.isConsumed()) return; - mMouseClicked = true; // Check if we are alive and kickin' if (!mMap || !localPlayer) return; @@ -522,7 +521,12 @@ void Viewport::mousePressed(MouseEvent &event) // Check if we are busy // if commented, allow context menu if npc dialog open if (PlayerInfo::isTalking()) + { + mMouseClicked = false; return; + } + + mMouseClicked = true; mMousePressX = event.getX(); mMousePressY = event.getY(); @@ -753,9 +757,9 @@ void Viewport::mouseDragged(MouseEvent &event) { mPlayerFollowMouse = true; } - } - walkByMouse(event); + walkByMouse(event); + } } void Viewport::mouseReleased(MouseEvent &event) -- cgit v1.2.3-70-g09d2