1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-29 01:19:11 +00:00

Fix: Using MIN_YEAR for a date is probably wrong, Use MIN_DATE instead. (#11444)

Even with strong types ...
This commit is contained in:
2023-11-05 15:43:56 +00:00
committed by GitHub
parent ef385499c7
commit b5861fd8f3
2 changed files with 4 additions and 1 deletions

View File

@@ -82,7 +82,7 @@ static const RoadTypeInfo _original_roadtypes[] = {
0x01,
/* introduction date */
static_cast<int32_t>(CalendarTime::MIN_YEAR),
CalendarTime::MIN_DATE,
/* roadtypes required for this to be introduced */
ROADTYPES_NONE,

View File

@@ -178,6 +178,9 @@ public:
/** The date of the first day of the original base year. */
static constexpr TimerGameCalendar::Date DAYS_TILL_ORIGINAL_BASE_YEAR = TimerGameCalendar::DateAtStartOfYear(ORIGINAL_BASE_YEAR);
/** The absolute minimum date. */
static constexpr TimerGameCalendar::Date MIN_DATE = 0;
/** The date of the last day of the max year. */
static constexpr TimerGameCalendar::Date MAX_DATE = TimerGameCalendar::DateAtStartOfYear(CalendarTime::MAX_YEAR + 1) - 1;