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

Function command_result plugin_load_site_data

plugins/fastdwarf.cpp:88–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88DFhackCExport command_result plugin_load_site_data (color_ostream &out) {
89 config = World::GetPersistentSiteData(CONFIG_KEY);
90
91 if (!config.isValid()) {
92 DEBUG(control,out).print("no config found in this save; initializing\n");
93 config = World::AddPersistentSiteData(CONFIG_KEY);
94 set_state(out, false, false);
95 } else {
96 is_enabled = config.get_int(CONFIG_FAST) || config.get_int(CONFIG_TELE);
97 DEBUG(control,out).print("loading persisted state: fast={}, tele={}\n",
98 config.get_int(CONFIG_FAST),
99 config.get_int(CONFIG_TELE));
100 }
101
102 return CR_OK;
103}
104
105DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_change_event event) {
106 if (event == DFHack::SC_WORLD_UNLOADED) {

Callers

nothing calls this directly

Calls 3

set_stateFunction · 0.85
isValidMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected