summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-28 22:10:30 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-28 22:10:30 +0300
commit15b9391da7ba4c307311d7dae6abc81a4b2bf25c (patch)
tree22abbcd556824073008de3493a42839848cef969 /src/actions
parentcd0883a1704c1b514b8b7317358949d43e230644 (diff)
downloadmanaplus-15b9391da7ba4c307311d7dae6abc81a4b2bf25c.tar.gz
manaplus-15b9391da7ba4c307311d7dae6abc81a4b2bf25c.tar.bz2
manaplus-15b9391da7ba4c307311d7dae6abc81a4b2bf25c.tar.xz
manaplus-15b9391da7ba4c307311d7dae6abc81a4b2bf25c.zip
Add chat command /npcmove. Also add it to npc context menu.
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/commands.cpp19
-rw-r--r--src/actions/commands.h1
2 files changed, 20 insertions, 0 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index 69acd89cf..ec377be79 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -68,6 +68,7 @@
#include "utils/chatutils.h"
#include "utils/gettext.h"
#include "utils/gmfunctions.h"
+#include "utils/parameters.h"
#include "utils/process.h"
#include "debug.h"
@@ -1472,4 +1473,22 @@ impHandler(commandUnjail)
return true;
}
+impHandler(commandNpcMove)
+{
+ const std::string args = event.args;
+ if (args.empty())
+ return false;
+ StringVect pars;
+ if (!splitParameters(pars, args, " ,", '\"'))
+ return false;
+
+ if (pars.size() != 3)
+ return false;
+
+ adminHandler->npcMove(pars[0],
+ atoi(pars[1].c_str()),
+ atoi(pars[2].c_str()));
+ return true;
+}
+
} // namespace Actions
diff --git a/src/actions/commands.h b/src/actions/commands.h
index 883b13d7b..f05921487 100644
--- a/src/actions/commands.h
+++ b/src/actions/commands.h
@@ -131,6 +131,7 @@ namespace Actions
decHandler(commandKill);
decHandler(commandJail);
decHandler(commandUnjail);
+ decHandler(commandNpcMove);
} // namespace Actions
#undef decHandler