Codechange: Use EnumBitSet for RoadTypes.

This commit is contained in:
Peter Nelson
2025-03-24 20:02:19 +00:00
committed by Peter Nelson
parent 819e097d6e
commit 732109e444
16 changed files with 75 additions and 83 deletions

View File

@@ -218,10 +218,10 @@ template <bool Tfrom, bool Tvia>
if (!ScriptRoad::IsRoadTypeAvailable(road_type)) return false;
for (const RoadStop *rs = ::Station::Get(station_id)->GetPrimaryRoadStop(RoadStopType::Bus); rs != nullptr; rs = rs->next) {
if (HasBit(::GetPresentRoadTypes(rs->xy), (::RoadType)road_type)) return true;
if (::GetPresentRoadTypes(rs->xy).Test(::RoadType(road_type))) return true;
}
for (const RoadStop *rs = ::Station::Get(station_id)->GetPrimaryRoadStop(RoadStopType::Truck); rs != nullptr; rs = rs->next) {
if (HasBit(::GetPresentRoadTypes(rs->xy), (::RoadType)road_type)) return true;
if (::GetPresentRoadTypes(rs->xy).Test(::RoadType(road_type))) return true;
}
return false;