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

Method stockpile_method

plugins/stockflow.cpp:112–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110 }
111
112 bool stockpile_method(const char *method, building_stockpilest *sp) {
113 // Combines the select_order and toggle_trigger method calls,
114 // because they share the same signature.
115 auto L = Lua::Core::State;
116 color_ostream_proxy out(Core::getInstance().getConsole());
117
118 Lua::StackUnwinder top(L);
119
120 if (!lua_checkstack(L, 2))
121 return false;
122
123 if (!Lua::PushModulePublic(out, L, "plugins.stockflow", method))
124 return false;
125
126 Lua::Push(L, sp);
127
128 if (!Lua::SafeCall(out, L, 1, 0))
129 return false;
130
131 // Invalidate the string cache.
132 stockpile_id = -1;
133
134 return true;
135 }
136
137 bool collect_settings(building_stockpilest *sp) {
138 // Find strings representing the job to order, and the trigger condition.

Callers 1

handleInputMethod · 0.80

Calls 4

lua_checkstackFunction · 0.85
PushModulePublicFunction · 0.85
PushFunction · 0.85
SafeCallFunction · 0.85

Tested by

no test coverage detected