diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-02-22 02:04:39 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-02-22 02:04:39 +0300 |
commit | 0a0ac45efa1305a8b40fc2b61f420b13c5e9fe9b (patch) | |
tree | 211171b163b49071fe230fea7cfafca0904cdc7d /src/gui/viewport.cpp | |
parent | 3da7f49e31f018047d6ed5869b5f4cebb9b29717 (diff) | |
download | manaplus-0a0ac45efa1305a8b40fc2b61f420b13c5e9fe9b.tar.gz manaplus-0a0ac45efa1305a8b40fc2b61f420b13c5e9fe9b.tar.bz2 manaplus-0a0ac45efa1305a8b40fc2b61f420b13c5e9fe9b.tar.xz manaplus-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.cpp | 10 |
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))) |