From 0a0ac45efa1305a8b40fc2b61f420b13c5e9fe9b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 22 Feb 2015 02:04:39 +0300 Subject: Allow move pet on big distances by hold stop attack (left shift) + mouse click. --- src/gui/viewport.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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( InputAction::ATTACK))) -- cgit v1.2.3-70-g09d2