Skip to content

Commit

Permalink
check maze against RCT1 type
Browse files Browse the repository at this point in the history
  • Loading branch information
spacek531 committed May 13, 2024
1 parent 18c443b commit 7649805
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/openrct2/rct1/S4Importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1668,6 +1668,7 @@ namespace RCT1
auto src2 = src->AsTrack();
const auto* ride = GetRide(RCT12RideIdToOpenRCT2RideId(src2->GetRideIndex()));
auto rideType = (ride != nullptr) ? ride->type : RIDE_TYPE_NULL;
auto rct1RideType = _s4.Rides[src2->GetRideIndex()].Type;

dst2->SetTrackType(RCT1TrackTypeToOpenRCT2(src2->GetTrackType(), rideType));
dst2->SetRideType(rideType);
Expand All @@ -1680,7 +1681,7 @@ namespace RCT1
dst2->SetStationIndex(StationIndex::FromUnderlying(src2->GetStationIndex()));
dst2->SetHasGreenLight(src2->HasGreenLight());
dst2->SetIsIndestructible(src2->IsIndestructible());
if (_s4.Rides[src2->GetRideIndex()].Type == RideType::GhostTrain)
if (rct1RideType == RideType::GhostTrain)
{
dst2->SetDoorAState(src2->GetDoorAState());
dst2->SetDoorBState(src2->GetDoorBState());
Expand All @@ -1704,8 +1705,7 @@ namespace RCT1
}

// This has to be done last, since the maze entry shares fields with the colour and sequence fields.
const auto& rtd = GetRideTypeDescriptor(rideType);
if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE))
if (rct1RideType == RideType::HedgeMaze)
{
dst2->SetMazeEntry(src2->GetMazeEntry());
}
Expand Down

0 comments on commit 7649805

Please sign in to comment.