From edd883853db9b90ccd27c38650f686908b166be0 Mon Sep 17 00:00:00 2001 From: Koncord Date: Sat, 20 Jan 2018 20:46:14 +0800 Subject: [PATCH] [Server] Add sendConsoleCommand function to lua api --- apps/openmw-mp/Object.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/openmw-mp/Object.cpp b/apps/openmw-mp/Object.cpp index 22ea72c8d..3968eee37 100644 --- a/apps/openmw-mp/Object.cpp +++ b/apps/openmw-mp/Object.cpp @@ -296,6 +296,12 @@ void ObjectController::Init(LuaState &lua) return lua.getObjectCtrl().sendContainers(player, objects, Utils::getCellFromDescription(cellDescription)); }); + objectCtrl.set_function("sendConsoleCommand", [&lua](shared_ptr player, shared_ptr>> objects, + const std::string &cellDescription, const std::string &command, + bool broadcast) { + return lua.getObjectCtrl().sendConsoleCommand(player, objects, Utils::getCellFromDescription(cellDescription), + command, broadcast); + }); objectCtrl.set_function("requestContainers", [&lua](shared_ptr player) { lua.getObjectCtrl().requestContainers(player); });