1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Validate ride type to create

This commit is contained in:
Michał Janiszewski
2016-01-15 15:24:33 +01:00
parent 57420cbc66
commit 260fa88bae

View File

@@ -5305,6 +5305,12 @@ money32 ride_create(int type, int subType, int flags, int *outRideIndex, int *ou
rct_ride_type *rideEntry;
int rideIndex, rideEntryIndex;
if (type > 90)
{
log_warning("Invalid request for ride type %u", type);
return MONEY32_UNDEFINED;
}
if (subType == 255) {
uint8 *availableRideEntries = get_ride_entry_indices_for_ride_type(type);
for (uint8 *rei = availableRideEntries; *rei != 255; rei++) {