1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 11:33:03 +01:00

Fix #14145: Crash in RCT2TrackTypeToOpenRCT2()

This commit is contained in:
Michael Steenbeek
2021-02-23 23:15:19 +01:00
committed by GitHub
parent aa11a1ee96
commit f32fe2b7e4

View File

@@ -145,7 +145,7 @@ bool RCT2TrackTypeIsBooster(uint8_t rideType, uint16_t trackType)
track_type_t RCT2TrackTypeToOpenRCT2(RCT12TrackType origTrackType, uint8_t rideType)
{
if (ride_type_has_flag(rideType, RIDE_TYPE_FLAG_FLAT_RIDE))
if (rideType < std::size(RideTypeDescriptors) && ride_type_has_flag(rideType, RIDE_TYPE_FLAG_FLAT_RIDE))
return RCT12FlatTrackTypeToOpenRCT2(origTrackType);
if (origTrackType == TrackElemType::RotationControlToggleAlias && !RCT2TrackTypeIsBooster(rideType, origTrackType))
return TrackElemType::RotationControlToggle;