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

Function adjust_units

plugins/timestream.cpp:482–493  ·  view source on GitHub ↗

unit needs appear to be incremented on season ticks, so we don't need to worry about those since the TICK_TRIGGERS check makes sure that we never skip season ticks

Source from the content-addressed store, hash-verified

480// unit needs appear to be incremented on season ticks, so we don't need to worry about those
481// since the TICK_TRIGGERS check makes sure that we never skip season ticks
482static void adjust_units(color_ostream &out, int32_t timeskip) {
483 for (auto unit : world->units.active) {
484 if (!Units::isActive(unit))
485 continue;
486 decrement_counter(unit, &df::unit::pregnancy_timer, timeskip);
487 Units::subtractGroupActionTimers(out, unit, timeskip, df::unit_action_type_group::All);
488 if (!Units::isOwnGroup(unit))
489 continue;
490 adjust_unit_counters(unit, timeskip);
491 adjust_job_counter(unit, timeskip);
492 }
493}
494
495// behavior ascertained from in-game observation
496static void adjust_activities(color_ostream &out, int32_t timeskip) {

Callers 1

do_cycleFunction · 0.85

Calls 3

decrement_counterFunction · 0.85
adjust_unit_countersFunction · 0.85
adjust_job_counterFunction · 0.85

Tested by

no test coverage detected