summaryrefslogtreecommitdiff
path: root/src/gui/viewport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r--src/gui/viewport.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 44e3aaa7d..7cf0cb1b1 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -519,7 +519,10 @@ void Viewport::mousePressed(MouseEvent &event)
if (!mLongMouseClick && eventButton == MouseEvent::LEFT)
{
if (leftMouseAction())
+ {
+ mPlayerFollowMouse = false;
return;
+ }
}
else if (eventButton == MouseEvent::MIDDLE)
{
@@ -659,9 +662,6 @@ void Viewport::walkByMouse(MouseEvent &event)
void Viewport::mouseDragged(MouseEvent &event)
{
- if (mLongMouseClick)
- return;
-
walkByMouse(event);
}
@@ -678,17 +678,18 @@ void Viewport::mouseReleased(MouseEvent &event)
// long button press
if (gui && gui->isLongPress())
{
- openContextMenu(event);
- gui->resetClickCount();
+ if (openContextMenu(event))
+ {
+ gui->resetClickCount();
+ return;
+ }
}
else
{
if (leftMouseAction())
return;
- if (event.getSource() != this)
- return;
- walkByMouse(event);
}
+ walkByMouse(event);
}
}
}