(svn r26138) -Fix [FS#5821] (r26105-ish): [Script] scripts could trigger the internal IsValidRoadType assertion

This commit is contained in:
rubidium 2013-11-29 18:06:14 +00:00
parent ebf46b7e4f
commit a7ac207c8f

View File

@ -53,7 +53,7 @@
/* static */ bool ScriptRoad::IsRoadTypeAvailable(RoadType road_type)
{
return ::HasRoadTypesAvail(ScriptObject::GetCompany(), ::RoadTypeToRoadTypes((::RoadType)road_type));
return ::IsValidRoadType((::RoadType)road_type) && ::HasRoadTypesAvail(ScriptObject::GetCompany(), ::RoadTypeToRoadTypes((::RoadType)road_type));
}
/* static */ ScriptRoad::RoadType ScriptRoad::GetCurrentRoadType()