| 2220 | } |
| 2221 | |
| 2222 | void Units::subtractGroupActionTimers(color_ostream &out, df::unit *unit, |
| 2223 | int32_t amount, df::unit_action_type_group affectedActionTypeGroup) |
| 2224 | { |
| 2225 | CHECK_NULL_POINTER(unit); |
| 2226 | for (auto action : unit->actions) { |
| 2227 | auto list = ENUM_ATTR(unit_action_type, group, action->type); |
| 2228 | for (size_t i = 0; i < list.size; i++) { |
| 2229 | if (list.items[i] == affectedActionTypeGroup) |
| 2230 | { |
| 2231 | mutateActionTimerCore(action, [=](double timerValue){ return max(timerValue - amount, 1.0); }); |
| 2232 | break; |
| 2233 | } |
| 2234 | } |
| 2235 | } |
| 2236 | } |
| 2237 | |
| 2238 | static bool validateMultiplyActionTimerAmount(color_ostream &out, float amount) { |
| 2239 | if (amount < 0) { |
nothing calls this directly
no test coverage detected