summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-26 11:58:28 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-26 11:58:28 +0300
commitae4062ed3c48706127c32efbc70cca0cc5ce19f8 (patch)
treeba2576179837ca60fe4340e55aef627b9df84405 /src/actions
parent2018073c8ec531d936321f2e6561b68d386f36a5 (diff)
downloadmv-ae4062ed3c48706127c32efbc70cca0cc5ce19f8.tar.gz
mv-ae4062ed3c48706127c32efbc70cca0cc5ce19f8.tar.bz2
mv-ae4062ed3c48706127c32efbc70cca0cc5ce19f8.tar.xz
mv-ae4062ed3c48706127c32efbc70cca0cc5ce19f8.zip
Move chat command /navigate into actions.
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/commands.cpp15
-rw-r--r--src/actions/commands.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index 5038d9f57..29e7e740c 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -394,4 +394,19 @@ impHandler(follow)
return true;
}
+impHandler(navigate)
+{
+ if (!localPlayer)
+ return false;
+
+ int x = 0;
+ int y = 0;
+
+ if (parse2Int(event.args, x, y))
+ localPlayer->navigateTo(x, y);
+ else
+ localPlayer->navigateClean();
+ return true;
+}
+
} // namespace Actions
diff --git a/src/actions/commands.h b/src/actions/commands.h
index 7034d0638..f5f4b4a5e 100644
--- a/src/actions/commands.h
+++ b/src/actions/commands.h
@@ -46,6 +46,7 @@ namespace Actions
decHandler(awayMessage);
decHandler(pseudoAway);
decHandler(follow);
+ decHandler(navigate);
} // namespace Actions
#undef decHandler