Codechange: introduce week/quarter triggers for TimerGameCalendar (#11189)

This simplifies code that triggers on these periods.
This commit is contained in:
Patric Stout
2023-08-12 16:02:11 +02:00
committed by GitHub
parent 02be6ab6ba
commit 01f55eb734
3 changed files with 31 additions and 2 deletions

View File

@@ -215,10 +215,22 @@ void TimerManager<TimerGameCalendar>::Elapsed(TimerGameCalendar::TElapsed delta)
timer->Elapsed(TimerGameCalendar::DAY);
}
if ((TimerGameCalendar::date % 7) == 3) {
for (auto timer : timers) {
timer->Elapsed(TimerGameCalendar::WEEK);
}
}
if (new_month) {
for (auto timer : timers) {
timer->Elapsed(TimerGameCalendar::MONTH);
}
if ((TimerGameCalendar::month % 3) == 0) {
for (auto timer : timers) {
timer->Elapsed(TimerGameCalendar::QUARTER);
}
}
}
if (new_year) {