mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #2936 from janisozaur/ride-subtype
Don't crash when dealing with a hacked ride subtype
This commit is contained in:
commit
b11fbe9ab1
|
@ -307,6 +307,9 @@ money32 ride_calculate_income_per_hour(rct_ride *ride)
|
||||||
int currentShopItem;
|
int currentShopItem;
|
||||||
|
|
||||||
entry = get_ride_entry(ride->subtype);
|
entry = get_ride_entry(ride->subtype);
|
||||||
|
if (entry == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
customersPerHour = ride_customers_per_hour(ride);
|
customersPerHour = ride_customers_per_hour(ride);
|
||||||
priceMinusCost = ride->price;
|
priceMinusCost = ride->price;
|
||||||
|
|
||||||
|
|
|
@ -1294,7 +1294,8 @@ static void scenario_objective_check_10_rollercoasters()
|
||||||
uint8 subtype_id = ride->subtype;
|
uint8 subtype_id = ride->subtype;
|
||||||
rct_ride_type *rideType = get_ride_entry(subtype_id);
|
rct_ride_type *rideType = get_ride_entry(subtype_id);
|
||||||
|
|
||||||
if ((rideType->category[0] == RIDE_GROUP_ROLLERCOASTER || rideType->category[1] == RIDE_GROUP_ROLLERCOASTER) &&
|
if (rideType != NULL &&
|
||||||
|
(rideType->category[0] == RIDE_GROUP_ROLLERCOASTER || rideType->category[1] == RIDE_GROUP_ROLLERCOASTER) &&
|
||||||
ride->status == RIDE_STATUS_OPEN &&
|
ride->status == RIDE_STATUS_OPEN &&
|
||||||
ride->excitement >= RIDE_RATING(6,00) && type_already_counted[subtype_id] == 0){
|
ride->excitement >= RIDE_RATING(6,00) && type_already_counted[subtype_id] == 0){
|
||||||
type_already_counted[subtype_id]++;
|
type_already_counted[subtype_id]++;
|
||||||
|
|
Loading…
Reference in New Issue