Fix: Road type is not available before its introduction date.

This commit is contained in:
Peter Nelson 2023-03-30 12:09:38 +01:00 committed by Michael Lutz
parent 726d05b22b
commit 1a93618bd1
1 changed files with 3 additions and 0 deletions

View File

@ -114,6 +114,9 @@ bool HasRoadTypeAvail(const CompanyID company, RoadType roadtype)
const RoadTypeInfo *rti = GetRoadTypeInfo(roadtype);
if (rti->label == 0) return false;
/* Not yet introduced at this date. */
if (IsInsideMM(rti->introduction_date, 0, MAX_DATE) && rti->introduction_date > TimerGameCalendar::date) return false;
/*
* Do not allow building hidden road types, except when a town may build it.
* The GS under deity mode, as well as anybody in the editor builds roads that are