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

Function clamp_coverage

plugins/timestream.cpp:312–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

310}
311
312static 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
325using df_tick_type = std::remove_reference_t<decltype(*cur_year_tick)>;
326

Callers 1

clamp_timeskipFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected