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

Method setActionTimers

library/modules/Units.cpp:2283–2292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2281}
2282
2283void Units::setActionTimers(color_ostream &out, df::unit *unit,
2284 int32_t amount, df::unit_action_type affectedActionType)
2285{
2286 CHECK_NULL_POINTER(unit);
2287 if (!validateSetActionTimerAmount(out, amount))
2288 return;
2289 for (auto action : unit->actions)
2290 if (affectedActionType == action->type)
2291 mutateActionTimerCore(action, [=](double timerValue){ return amount; });
2292}
2293
2294void Units::setGroupActionTimers(color_ostream &out, df::unit *unit,
2295 int32_t amount, df::unit_action_type_group affectedActionTypeGroup)

Callers

nothing calls this directly

Calls 2

mutateActionTimerCoreFunction · 0.85

Tested by

no test coverage detected