Skip to content

Commit

Permalink
Fix OpenRCT2#21358: Crash during RCT1 research import
Browse files Browse the repository at this point in the history
  • Loading branch information
Gymnasiast committed Feb 10, 2024
1 parent 0c1991c commit 953b0b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/openrct2/rct1/S4Importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2095,7 +2095,7 @@ namespace RCT1
uint8_t vehicle = researchItem.Item;
auto rideEntryIndex = _vehicleTypeToRideEntryMap[vehicle];

if (!_researchRideEntryUsed[rideEntryIndex])
if (rideEntryIndex < std::size(_researchRideEntryUsed) && !_researchRideEntryUsed[rideEntryIndex])
{
_researchRideEntryUsed[rideEntryIndex] = true;
ResearchInsertRideEntry(rideEntryIndex, researched);
Expand Down

0 comments on commit 953b0b5

Please sign in to comment.