summaryrefslogtreecommitdiff
path: root/src/gui/viewport.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-22 02:04:39 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-22 02:04:39 +0300
commit0a0ac45efa1305a8b40fc2b61f420b13c5e9fe9b (patch)
tree211171b163b49071fe230fea7cfafca0904cdc7d /src/gui/viewport.cpp
parent3da7f49e31f018047d6ed5869b5f4cebb9b29717 (diff)
downloadmanaverse-0a0ac45efa1305a8b40fc2b61f420b13c5e9fe9b.tar.gz
manaverse-0a0ac45efa1305a8b40fc2b61f420b13c5e9fe9b.tar.bz2
manaverse-0a0ac45efa1305a8b40fc2b61f420b13c5e9fe9b.tar.xz
manaverse-0a0ac45efa1305a8b40fc2b61f420b13c5e9fe9b.zip
Allow move pet on big distances by hold stop attack (left shift) + mouse click.
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r--src/gui/viewport.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 7504edcbb..ec723f103 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -474,6 +474,16 @@ bool Viewport::leftMouseAction()
validateSpeed();
localPlayer->pickUp(mHoverItem);
}
+ else if (inputManager.isActionActive(InputAction::STOP_ATTACK))
+ {
+ const int mouseTileX = (mMouseX + mPixelViewX)
+ / mMap->getTileWidth();
+ const int mouseTileY = (mMouseY + mPixelViewY)
+ / mMap->getTileHeight();
+ inputManager.executeChatCommand(InputAction::PET_MOVE,
+ strprintf("%d %d", mouseTileX, mouseTileY),
+ nullptr);
+ }
// Just walk around
else if (!inputManager.isActionActive(static_cast<int>(
InputAction::ATTACK)))