diff options
author | rubidium <rubidium@openttd.org> | 2013-11-29 18:06:14 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2013-11-29 18:06:14 +0000 |
commit | eec66b089d3e72c03fad3adb117447873afc7065 (patch) | |
tree | 14db3077ceb96ddceb331fee9d135607a8198d5e | |
parent | 354ec53b3c48fe0c5bb22a46acf62f57e10050fc (diff) | |
download | openttd-eec66b089d3e72c03fad3adb117447873afc7065.tar.xz |
(svn r26138) -Fix [FS#5821] (r26105-ish): [Script] scripts could trigger the internal IsValidRoadType assertion
-rw-r--r-- | src/script/api/script_road.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/api/script_road.cpp b/src/script/api/script_road.cpp index 137ae7618..e4980296c 100644 --- a/src/script/api/script_road.cpp +++ b/src/script/api/script_road.cpp @@ -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() |