MCPcopy Create free account
hub / github.com/DFHack/dfhack / command_method

Method command_method

plugins/stockflow.cpp:94–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92 }
93
94 bool command_method(const char *method, color_ostream &out) {
95 // Calls a lua function with no parameters.
96
97 auto L = Lua::Core::State;
98 Lua::StackUnwinder top(L);
99
100 if (!lua_checkstack(L, 1))
101 return false;
102
103 if (!Lua::PushModulePublic(out, L, "plugins.stockflow", method))
104 return false;
105
106 if (!Lua::SafeCall(out, L, 0, 0))
107 return false;
108
109 return true;
110 }
111
112 bool stockpile_method(const char *method, building_stockpilest *sp) {
113 // Combines the select_order and toggle_trigger method calls,

Callers 1

stockflow_cmdFunction · 0.80

Calls 3

lua_checkstackFunction · 0.85
PushModulePublicFunction · 0.85
SafeCallFunction · 0.85

Tested by

no test coverage detected