mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-10 08:00:05 +00:00
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:
parent
6810d09c1b
commit
4651ad94fe
@ -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…
Reference in New Issue
Block a user