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

Function adjust_buildings

plugins/timestream.cpp:674–687  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

672}
673
674static void adjust_buildings(color_ostream &out, int32_t timeskip) {
675 // decrement trap timers
676 for (df::building_trapst *tr : world->buildings.other.TRAP) {
677 decrement_counter(tr, &df::building_trapst::ready_timeout, timeskip);
678 // used by pressure plates to delay until the plate is triggerable again
679 // other trap types never set this to a value higher than 1 so it is safe to decrement here
680 decrement_counter(tr, &df::building_trapst::state, timeskip);
681 }
682
683 for (df::building *bld : world->buildings.all) {
684 // assumes age > 0, but that will become true very quickly for all new buildings
685 increment_counter(bld, &df::building::age, timeskip);
686 }
687}
688
689static void adjust_items(color_ostream &out, int32_t timeskip) {
690 // increment incubation counters for fertile eggs in non-forbidden nestboxes

Callers 1

do_cycleFunction · 0.85

Calls 2

decrement_counterFunction · 0.85
increment_counterFunction · 0.85

Tested by

no test coverage detected