From 15b9391da7ba4c307311d7dae6abc81a4b2bf25c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 28 Feb 2016 22:10:30 +0300 Subject: Add chat command /npcmove. Also add it to npc context menu. --- src/actions/commands.cpp | 19 +++++++++++++++++++ src/actions/commands.h | 1 + 2 files changed, 20 insertions(+) (limited to 'src/actions') 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 -- cgit v1.2.3-70-g09d2