1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 15:24:30 +01:00

Reduce direct ride type checking; move available piece lookup to RTD (#11353)

This commit is contained in:
Michael Steenbeek
2020-04-19 13:32:43 +02:00
committed by GitHub
parent d17b4606f3
commit 8127437de1
12 changed files with 42 additions and 41 deletions

View File

@@ -1436,7 +1436,7 @@ static GameActionResult::Ptr map_can_construct_with_clear_at(
&& tileElement->GetBaseZ() == pos.baseZ && tileElement->AsTrack()->GetTrackType() == TRACK_ELEM_FLAT)
{
auto ride = get_ride(tileElement->AsTrack()->GetRideIndex());
if (ride != nullptr && ride->type == RIDE_TYPE_MINIATURE_RAILWAY)
if (ride != nullptr && RideTypeDescriptors[ride->type].HasFlag(RIDE_TYPE_FLAG_SUPPORTS_LEVEL_CROSSINGS))
{
continue;
}