MCPcopy Create free account
hub / github.com/DFHack/dfhack / command_result plugin_onstatechange

Function command_result plugin_onstatechange

plugins/stockflow.cpp:345–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343
344
345DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_change_event event) {
346 if (event == DFHack::SC_MAP_LOADED) {
347 if (!helper.reset(out, enabled)) {
348 out.printerr("Could not load stockflow world data!\n");
349 return CR_FAILURE;
350 }
351 } else if (event == DFHack::SC_MAP_UNLOADED) {
352 if (!helper.reset(out, false)) {
353 out.printerr("Could not unload stockflow world data!\n");
354 return CR_FAILURE;
355 }
356 }
357
358 return CR_OK;
359}
360
361DFhackCExport command_result plugin_enable(color_ostream& out, bool enable) {
362 /* Accept the "enable stockflow"/"disable stockflow" syntax, where available. */

Callers

nothing calls this directly

Calls 1

resetMethod · 0.45

Tested by

no test coverage detected