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

Function get_next_trigger_year_tick

plugins/timestream.cpp:291–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289}
290
291static int32_t get_next_trigger_year_tick(int32_t next_tick) {
292 int32_t next_trigger_tick = INT32_MAX;
293 for (auto trigger : TICK_TRIGGERS) {
294 int32_t cur_rem = next_tick % trigger.first;
295 for (auto rem : trigger.second) {
296 if (cur_rem <= rem) {
297 next_trigger_tick = std::min(next_trigger_tick, next_tick + (rem - cur_rem));
298 continue;
299 }
300 }
301 next_trigger_tick = std::min(next_trigger_tick, next_tick + trigger.first - cur_rem + trigger.second.back());
302 }
303 return next_trigger_tick;
304}
305
306static int32_t get_next_birthday(int32_t next_tick) {
307 if (next_tick < 0 || next_tick >= (int32_t)birthday_triggers.size())

Callers 1

clamp_timeskipFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected