diff options
Diffstat (limited to 'src/script/api/script_station.cpp')
-rw-r--r-- | src/script/api/script_station.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/script/api/script_station.cpp b/src/script/api/script_station.cpp index 3b3bae33c..e5536c6e0 100644 --- a/src/script/api/script_station.cpp +++ b/src/script/api/script_station.cpp @@ -211,13 +211,11 @@ template<bool Tfrom, bool Tvia> if (!IsValidStation(station_id)) return false; if (!ScriptRoad::IsRoadTypeAvailable(road_type)) return false; - ::RoadTypes r = RoadTypeToRoadTypes((::RoadType)road_type); - for (const RoadStop *rs = ::Station::Get(station_id)->GetPrimaryRoadStop(ROADSTOP_BUS); rs != nullptr; rs = rs->next) { - if ((::GetRoadTypes(rs->xy) & r) != 0) return true; + if (HasBit(::GetPresentRoadTypes(rs->xy), (::RoadType)road_type)) return true; } for (const RoadStop *rs = ::Station::Get(station_id)->GetPrimaryRoadStop(ROADSTOP_TRUCK); rs != nullptr; rs = rs->next) { - if ((::GetRoadTypes(rs->xy) & r) != 0) return true; + if (HasBit(::GetPresentRoadTypes(rs->xy), (::RoadType)road_type)) return true; } return false; |