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

Function command_result plugin_load_site_data

plugins/dig.cpp:125–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125DFhackCExport command_result plugin_load_site_data(color_ostream &out) {
126 cycle_timestamp = 0;
127 is_painting_warm = false;
128 is_painting_damp = false;
129
130 warm_config = World::GetPersistentSiteData(WARM_CONFIG_KEY);
131 damp_config = World::GetPersistentSiteData(DAMP_CONFIG_KEY);
132
133 if (!warm_config.isValid()) {
134 DEBUG(log,out).print("no warm dig config found in this save; initializing\n");
135 warm_config = World::AddPersistentSiteData(WARM_CONFIG_KEY);
136 }
137 if (!damp_config.isValid()) {
138 DEBUG(log,out).print("no damp dig config found in this save; initializing\n");
139 damp_config = World::AddPersistentSiteData(DAMP_CONFIG_KEY);
140 }
141
142 for (auto & block : world->map.map_blocks) {
143 auto warm_mask = World::getPersistentTilemask(warm_config, block);
144 auto damp_mask = World::getPersistentTilemask(damp_config, block);
145 if (warm_mask || damp_mask) {
146 do_enable(true);
147 break;
148 }
149 }
150
151 return CR_OK;
152}
153
154DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_change_event event) {
155 if (event == DFHack::SC_WORLD_UNLOADED) {

Callers

nothing calls this directly

Calls 3

do_enableFunction · 0.70
isValidMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected