1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-29 17:54:50 +01:00

Implement GameAction for setting date

This commit is contained in:
Michael Steenbeek
2019-03-31 19:48:51 +02:00
committed by GitHub
parent e38efcbec4
commit b618bbdcd4
10 changed files with 84 additions and 14 deletions

View File

@@ -67,7 +67,7 @@ void date_reset()
void date_set(int32_t year, int32_t month, int32_t day)
{
year = std::clamp(year, 1, 8192);
year = std::clamp(year, 1, MAX_YEAR);
month = std::clamp(month, 1, (int)MONTH_COUNT);
day = std::clamp(day, 1, (int)days_in_month[month - 1]);
gDateMonthsElapsed = (year - 1) * MONTH_COUNT + month - 1;