summaryrefslogtreecommitdiff
path: root/src/actions/commands.cpp
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/commands.cpp
parentcd0883a1704c1b514b8b7317358949d43e230644 (diff)
downloadplus-15b9391da7ba4c307311d7dae6abc81a4b2bf25c.tar.gz
plus-15b9391da7ba4c307311d7dae6abc81a4b2bf25c.tar.bz2
plus-15b9391da7ba4c307311d7dae6abc81a4b2bf25c.tar.xz
plus-15b9391da7ba4c307311d7dae6abc81a4b2bf25c.zip
Add chat command /npcmove. Also add it to npc context menu.
Diffstat (limited to 'src/actions/commands.cpp')
-rw-r--r--src/actions/commands.cpp19
1 files changed, 19 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