Fix: commands with a RoadType in their arguments were not validated properly (#9944)

Although it was checked that RoadType was not 63 (INVALID_ROADTYPE),
and all values lower than 63 are fine, it also allowed values higher
than 63. As the RoadType is a "byte", it could contain values up
to 255.
This commit is contained in:
Patric Stout 2022-07-09 10:03:57 +02:00 committed by GitHub
parent 6810d09c1b
commit 4651ad94fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -141,7 +141,7 @@ bool HasAnyRoadTypesAvail(CompanyID company, RoadTramType rtt)
*/
bool ValParamRoadType(RoadType roadtype)
{
return roadtype != INVALID_ROADTYPE && HasRoadTypeAvail(_current_company, roadtype);
return roadtype < ROADTYPE_END && HasRoadTypeAvail(_current_company, roadtype);
}
/**