Merge pull request #2731 from janisozaur/ride-type

Validate ride type to create
This commit is contained in:
Ted John 2016-01-15 20:17:57 +00:00
commit b4125e87cb
1 changed files with 6 additions and 0 deletions

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++) {