Skip to content

Commit

Permalink
Fix: Road type is not available before its introduction date.
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterN committed May 9, 2023
1 parent 584ca38 commit 5f87b30
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/road.cpp
Expand Up @@ -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_DAY) && rti->introduction_date > _date) return false;

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / Emscripten

use of undeclared identifier 'MAX_DAY'

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / Emscripten

use of undeclared identifier '_date'

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / Mac OS (x64)

use of undeclared identifier 'MAX_DAY'

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / Mac OS (x64)

use of undeclared identifier '_date'

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / Linux (Clang)

use of undeclared identifier 'MAX_DAY'

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / Linux (Clang)

use of undeclared identifier '_date'

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / Linux (GCC - SDL2)

‘MAX_DAY’ was not declared in this scope; did you mean ‘MAX_DATE’?

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / Linux (GCC - SDL2)

‘_date’ was not declared in this scope

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / Linux (GCC - SDL1.2)

‘MAX_DAY’ was not declared in this scope; did you mean ‘MAX_DATE’?

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / Linux (GCC - SDL1.2)

‘_date’ was not declared in this scope

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / Linux (GCC - Dedicated)

‘MAX_DAY’ was not declared in this scope; did you mean ‘MAX_DATE’?

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / Linux (GCC - Dedicated)

‘_date’ was not declared in this scope

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / Windows (windows-latest / x86)

'MAX_DAY': undeclared identifier

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / Windows (windows-latest / x86)

'_date': undeclared identifier

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / Windows (windows-latest / x64)

'MAX_DAY': undeclared identifier

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / Windows (windows-latest / x64)

'_date': undeclared identifier

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / Windows (windows-2019 / x86)

'MAX_DAY': undeclared identifier

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / Windows (windows-2019 / x86)

'_date': undeclared identifier

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / Windows (windows-2019 / x64)

'MAX_DAY': undeclared identifier

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / Windows (windows-2019 / x64)

'_date': undeclared identifier

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / MinGW (x86_64)

'MAX_DAY' was not declared in this scope; did you mean 'MAX_PAL'?

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / MinGW (x86_64)

'_date' was not declared in this scope

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / MinGW (i686)

'MAX_DAY' was not declared in this scope; did you mean 'MAX_PAL'?

Check failure on line 118 in src/road.cpp

View workflow job for this annotation

GitHub Actions / MinGW (i686)

'_date' was not declared in this scope

/*
* 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
Expand Down

0 comments on commit 5f87b30

Please sign in to comment.