mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #3111 from janisozaur/ride-type
Be more careful when dealing with hacked rides. Fix #3109
This commit is contained in:
commit
09f0caf8c1
|
@ -140,6 +140,9 @@ static int award_is_deserved_best_rollercoasters(int awardType, int activeAwardT
|
|||
rollerCoasters = 0;
|
||||
FOR_ALL_RIDES(i, ride) {
|
||||
rideType = get_ride_entry(ride->subtype);
|
||||
if (rideType == NULL) {
|
||||
continue;
|
||||
}
|
||||
if (rideType->category[0] != RIDE_GROUP_ROLLERCOASTER && rideType->category[1] != RIDE_GROUP_ROLLERCOASTER)
|
||||
continue;
|
||||
|
||||
|
@ -296,6 +299,9 @@ static int award_is_deserved_best_food(int awardType, int activeAwardTypes)
|
|||
|
||||
shops++;
|
||||
rideType = get_ride_entry(ride->subtype);
|
||||
if (rideType == NULL) {
|
||||
continue;
|
||||
}
|
||||
if (!(shopTypes & (1ULL << rideType->shop_item))) {
|
||||
shopTypes |= (1ULL << rideType->shop_item);
|
||||
uniqueShops++;
|
||||
|
@ -342,6 +348,9 @@ static int award_is_deserved_worst_food(int awardType, int activeAwardTypes)
|
|||
|
||||
shops++;
|
||||
rideType = get_ride_entry(ride->subtype);
|
||||
if (rideType == NULL) {
|
||||
continue;
|
||||
}
|
||||
if (!(shopTypes & (1ULL << rideType->shop_item))) {
|
||||
shopTypes |= (1ULL << rideType->shop_item);
|
||||
uniqueShops++;
|
||||
|
@ -439,6 +448,9 @@ static int award_is_deserved_best_water_rides(int awardType, int activeAwardType
|
|||
waterRides = 0;
|
||||
FOR_ALL_RIDES(i, ride) {
|
||||
rideType = get_ride_entry(ride->subtype);
|
||||
if (rideType == NULL) {
|
||||
continue;
|
||||
}
|
||||
if (rideType->category[0] != RIDE_GROUP_WATER && rideType->category[1] != RIDE_GROUP_WATER)
|
||||
continue;
|
||||
|
||||
|
@ -539,6 +551,9 @@ static int award_is_deserved_best_gentle_rides(int awardType, int activeAwardTyp
|
|||
gentleRides = 0;
|
||||
FOR_ALL_RIDES(i, ride) {
|
||||
rideType = get_ride_entry(ride->subtype);
|
||||
if (rideType == NULL) {
|
||||
continue;
|
||||
}
|
||||
if (rideType->category[0] != RIDE_GROUP_GENTLE && rideType->category[1] != RIDE_GROUP_GENTLE)
|
||||
continue;
|
||||
|
||||
|
|
|
@ -214,6 +214,9 @@ bool marketing_is_campaign_type_applicable(int campaignType)
|
|||
// Check if any food or drink stalls exist
|
||||
FOR_ALL_RIDES(i, ride) {
|
||||
rideEntry = get_ride_entry(ride->subtype);
|
||||
if (rideEntry == NULL) {
|
||||
continue;
|
||||
}
|
||||
if (
|
||||
shop_item_is_food_or_drink(rideEntry->shop_item) ||
|
||||
shop_item_is_food_or_drink(rideEntry->shop_item_secondary)
|
||||
|
|
|
@ -5687,6 +5687,9 @@ static money32 shop_item_get_common_price(rct_ride *forRide, int shopItem)
|
|||
FOR_ALL_RIDES(i, ride) {
|
||||
if (ride != forRide) {
|
||||
rideEntry = get_ride_entry(ride->subtype);
|
||||
if (rideEntry == NULL) {
|
||||
continue;
|
||||
}
|
||||
if (rideEntry->shop_item == shopItem) {
|
||||
return ride->price;
|
||||
}
|
||||
|
|
|
@ -1299,6 +1299,9 @@ static void scenario_objective_check_10_rollercoasters()
|
|||
FOR_ALL_RIDES(i, ride) {
|
||||
uint8 subtype_id = ride->subtype;
|
||||
rct_ride_entry *rideType = get_ride_entry(subtype_id);
|
||||
if (rideType == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (rideType != NULL &&
|
||||
(rideType->category[0] == RIDE_GROUP_ROLLERCOASTER || rideType->category[1] == RIDE_GROUP_ROLLERCOASTER) &&
|
||||
|
@ -1377,6 +1380,9 @@ static void scenario_objective_check_10_rollercoasters_length()
|
|||
FOR_ALL_RIDES(i, ride) {
|
||||
uint8 subtype_id = ride->subtype;
|
||||
rct_ride_entry *rideType = get_ride_entry(subtype_id);
|
||||
if (rideType == NULL) {
|
||||
continue;
|
||||
}
|
||||
if ((rideType->category[0] == RIDE_GROUP_ROLLERCOASTER || rideType->category[1] == RIDE_GROUP_ROLLERCOASTER) &&
|
||||
ride->status == RIDE_STATUS_OPEN &&
|
||||
ride->excitement >= RIDE_RATING(7,00) && type_already_counted[subtype_id] == 0){
|
||||
|
|
|
@ -200,6 +200,9 @@ static void window_new_campaign_get_shop_items()
|
|||
uint64 items = 0;
|
||||
FOR_ALL_RIDES(i, ride) {
|
||||
rct_ride_entry *rideType = get_ride_entry(ride->subtype);
|
||||
if (rideType == NULL) {
|
||||
continue;
|
||||
}
|
||||
uint8 itemType = rideType->shop_item;
|
||||
if (itemType != 255)
|
||||
items |= 1LL << itemType;
|
||||
|
|
Loading…
Reference in New Issue