| 310 | } |
| 311 | |
| 312 | static int32_t clamp_coverage(int32_t timeskip) { |
| 313 | if (season_tick_throttled) |
| 314 | return timeskip; |
| 315 | for (int32_t val = 1; val <= timeskip; ++val) { |
| 316 | uint32_t coverage_slot = (*cur_year_tick + val) % NUM_COVERAGE_TICKS; |
| 317 | if (coverage_slot < NUM_COVERAGE_TICKS && !tick_coverage[coverage_slot]) { |
| 318 | season_tick_throttled = true; |
| 319 | return val - 1; |
| 320 | } |
| 321 | } |
| 322 | return timeskip; |
| 323 | } |
| 324 | |
| 325 | using df_tick_type = std::remove_reference_t<decltype(*cur_year_tick)>; |
| 326 |