| 398 | } |
| 399 | |
| 400 | static int32_t clamp_timeskip(int32_t timeskip) { |
| 401 | if (timeskip <= 0) |
| 402 | return 0; |
| 403 | // timeskip cannot be applied when caravans are loading/unloading because we don't know how to jog that timer |
| 404 | if (detect_caravans()) |
| 405 | return 0; |
| 406 | int32_t next_tick = *cur_year_tick + 1; |
| 407 | timeskip = std::min(timeskip, get_next_trigger_year_tick(next_tick) - next_tick); |
| 408 | timeskip = std::min(timeskip, get_next_birthday(next_tick) - next_tick); |
| 409 | timeskip = std::min(timeskip, flows_next_required_tick() - next_tick); |
| 410 | return clamp_coverage(timeskip); |
| 411 | } |
| 412 | |
| 413 | template <typename FT, typename T> |
| 414 | static void increment_counter(T *obj, FT T::*field, int32_t timeskip) { |
no test coverage detected