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

Function command_result plugin_onupdate

plugins/fastdwarf.cpp:152–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152DFhackCExport command_result plugin_onupdate(color_ostream &out) {
153 DEBUG(cycle,out).print("running {} cycle\n", plugin_name);
154
155 // fast mode 2 is handled by DF itself
156 bool is_fast = config.get_int(CONFIG_FAST) == 1;
157 bool is_tele = config.get_int(CONFIG_TELE) == 1;
158
159 Units::forCitizens([&](auto unit) {
160 if (is_tele)
161 do_tele(out, unit);
162
163 if (is_fast) {
164 DEBUG(cycle,out).print("fastifying unit {}\n", unit->id);
165 Units::setGroupActionTimers(out, unit, 1, df::unit_action_type_group::All);
166 }
167 });
168
169 return CR_OK;
170}
171
172/////////////////////////////////////////////////////
173// CLI logic

Callers

nothing calls this directly

Calls 2

do_teleFunction · 0.85
printMethod · 0.45

Tested by

no test coverage detected