Codechange: Move date consts and functions to CalendarTime and TimerGameCalendar classes

This commit is contained in:
Tyler Trahan
2023-08-16 09:43:31 -04:00
parent fca2b37726
commit 77173a6a10
66 changed files with 400 additions and 393 deletions

View File

@@ -291,7 +291,7 @@ TownScopeResolver *StationResolverObject::GetTown()
}
break;
case 0xFA: return ClampTo<uint16_t>(TimerGameCalendar::date - DAYS_TILL_ORIGINAL_BASE_YEAR); // Build date, clamped to a 16 bit value
case 0xFA: return ClampTo<uint16_t>(TimerGameCalendar::date - CalendarTime::DAYS_TILL_ORIGINAL_BASE_YEAR); // Build date, clamped to a 16 bit value
}
*available = false;
@@ -381,7 +381,7 @@ TownScopeResolver *StationResolverObject::GetTown()
case 0x84: return this->st->string_id;
case 0x86: return 0;
case 0xF0: return this->st->facilities;
case 0xFA: return ClampTo<uint16_t>(this->st->build_date - DAYS_TILL_ORIGINAL_BASE_YEAR);
case 0xFA: return ClampTo<uint16_t>(this->st->build_date - CalendarTime::DAYS_TILL_ORIGINAL_BASE_YEAR);
}
return this->st->GetNewGRFVariable(this->ro, variable, parameter, available);