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

Method subtractActionTimers

library/modules/Units.cpp:2213–2220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2211}
2212
2213void Units::subtractActionTimers(color_ostream &out, df::unit *unit,
2214 int32_t amount, df::unit_action_type affectedActionType)
2215{
2216 CHECK_NULL_POINTER(unit);
2217 for (auto action : unit->actions)
2218 if (affectedActionType == action->type)
2219 mutateActionTimerCore(action, [=](double timerValue){ return max(timerValue - amount, 1.0); });
2220}
2221
2222void Units::subtractGroupActionTimers(color_ostream &out, df::unit *unit,
2223 int32_t amount, df::unit_action_type_group affectedActionTypeGroup)

Callers

nothing calls this directly

Calls 1

mutateActionTimerCoreFunction · 0.85

Tested by

no test coverage detected