| 757 | } |
| 758 | |
| 759 | command_result CoreService::RunLua(color_ostream &stream, |
| 760 | const dfproto::CoreRunLuaRequest *in, |
| 761 | StringListMessage *out) |
| 762 | { |
| 763 | auto L = DFHack::Core::getInstance().getLuaState(); |
| 764 | LuaFunctionData data = { CR_FAILURE, in, out }; |
| 765 | |
| 766 | lua_pushcfunction(L, doRunLuaFunction); |
| 767 | lua_pushlightuserdata(L, &data); |
| 768 | |
| 769 | if (!Lua::Core::SafeCall(stream, 1, 0)) |
| 770 | return CR_FAILURE; |
| 771 | |
| 772 | return data.rv; |
| 773 | } |
| 774 | |
| 775 | int CoreService::doRunLuaFunction(lua_State *L) |
| 776 | { |
nothing calls this directly
no test coverage detected