| 289 | } |
| 290 | |
| 291 | static 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 | |
| 306 | static int32_t get_next_birthday(int32_t next_tick) { |
| 307 | if (next_tick < 0 || next_tick >= (int32_t)birthday_triggers.size()) |