Changeset - r28094:10fb5670fa7c
[Not reviewed]
master
0 2 0
Peter Nelson - 13 months ago 2023-11-05 15:43:56
peter1138@openttd.org
Fix: Using MIN_YEAR for a date is probably wrong, Use MIN_DATE instead. (#11444)

Even with strong types ...
2 files changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/table/roadtypes.h
Show inline comments
 
@@ -82,7 +82,7 @@ static const RoadTypeInfo _original_road
 
		0x01,
 

	
 
		/* introduction date */
 
		static_cast<int32_t>(CalendarTime::MIN_YEAR),
 
		CalendarTime::MIN_DATE,
 

	
 
		/* roadtypes required for this to be introduced */
 
		ROADTYPES_NONE,
src/timer/timer_game_calendar.h
Show inline comments
 
@@ -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;
 

	
0 comments (0 inline, 0 general)