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

Even with strong types ...
This commit is contained in:
Peter Nelson 2023-11-05 15:43:56 +00:00 committed by GitHub
parent ef385499c7
commit b5861fd8f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

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

View File

@ -178,6 +178,9 @@ public:
/** The date of the first day of the original base year. */ /** 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); 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. */ /** The date of the last day of the max year. */
static constexpr TimerGameCalendar::Date MAX_DATE = TimerGameCalendar::DateAtStartOfYear(CalendarTime::MAX_YEAR + 1) - 1; static constexpr TimerGameCalendar::Date MAX_DATE = TimerGameCalendar::DateAtStartOfYear(CalendarTime::MAX_YEAR + 1) - 1;