summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-22 22:09:02 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-22 22:09:02 +0300
commit51c9a63a660fe88cfa44d93028e6ae2448fb889d (patch)
tree8c4b1db548208737a43d52fbe28b99cb5060f017 /src/actions
parentbce511aaf8b9d2b5d447f67ba0c05e2f9a92b7ca (diff)
downloadplus-51c9a63a660fe88cfa44d93028e6ae2448fb889d.tar.gz
plus-51c9a63a660fe88cfa44d93028e6ae2448fb889d.tar.bz2
plus-51c9a63a660fe88cfa44d93028e6ae2448fb889d.tar.xz
plus-51c9a63a660fe88cfa44d93028e6ae2448fb889d.zip
Not allow moving from sit state if server not support it.
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/commands.cpp10
-rw-r--r--src/actions/move.cpp8
2 files changed, 16 insertions, 2 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index 1c57bd677..529025481 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -459,8 +459,11 @@ impHandler(follow)
impHandler(navigate)
{
- if (!localPlayer)
+ if (!localPlayer ||
+ !localPlayer->canMove())
+ {
return false;
+ }
int x = 0;
int y = 0;
@@ -474,8 +477,11 @@ impHandler(navigate)
impHandler(navigateTo)
{
- if (!localPlayer)
+ if (!localPlayer ||
+ !localPlayer->canMove())
+ {
return false;
+ }
const std::string args = event.args;
if (args.empty())
diff --git a/src/actions/move.cpp b/src/actions/move.cpp
index 2c9a3b692..789556910 100644
--- a/src/actions/move.cpp
+++ b/src/actions/move.cpp
@@ -71,6 +71,8 @@ impHandler(moveUp)
return petDirectUp(event);
else if (inputManager.isActionActive(InputAction::STOP_ATTACK))
return petMoveUp(event);
+ else if (!localPlayer->canMove())
+ return directUp(event);
if (popupMenu->isPopupVisible())
{
popupMenu->moveUp();
@@ -87,6 +89,8 @@ impHandler(moveDown)
return petDirectDown(event);
else if (inputManager.isActionActive(InputAction::STOP_ATTACK))
return petMoveDown(event);
+ else if (!localPlayer->canMove())
+ return directDown(event);
if (popupMenu->isPopupVisible())
{
popupMenu->moveDown();
@@ -110,6 +114,8 @@ impHandler(moveLeft)
return petDirectLeft(event);
else if (inputManager.isActionActive(InputAction::STOP_ATTACK))
return petMoveLeft(event);
+ else if (!localPlayer->canMove())
+ return directLeft(event);
return closeMoveNpcDialog(false);
}
@@ -128,6 +134,8 @@ impHandler(moveRight)
return petDirectRight(event);
else if (inputManager.isActionActive(InputAction::STOP_ATTACK))
return petMoveRight(event);
+ else if (!localPlayer->canMove())
+ return directRight(event);
return closeMoveNpcDialog(false);
}