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.
pull/428/head
Patric Stout 2 years ago committed by GitHub
parent 6810d09c1b
commit 4651ad94fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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);
}
/**

Loading…
Cancel
Save