From 02a14d388395bf4964149c299780d9477934726b Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 8 Feb 2019 16:45:36 +0100 Subject: [PATCH] Move setting common price into RideSetCommonPrice --- src/openrct2/actions/RideSetPriceAction.hpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/openrct2/actions/RideSetPriceAction.hpp b/src/openrct2/actions/RideSetPriceAction.hpp index 722f4f0b16..4a4f8ed483 100644 --- a/src/openrct2/actions/RideSetPriceAction.hpp +++ b/src/openrct2/actions/RideSetPriceAction.hpp @@ -152,14 +152,23 @@ public: } } - ride = get_ride(0); + // Synchronize prices if enabled. + RideSetCommonPrice(shopItem); + + return res; + } + +private: + void RideSetCommonPrice(int32_t shopItem) const + { + Ride* ride = get_ride(0); for (uint8_t rideId = 0; rideId < MAX_RIDES; rideId++, ride++) { // Unplaced rides have a type of NULL if (ride->type == RIDE_TYPE_NULL) continue; - rideEntry = get_ride_entry(ride->subtype); + rct_ride_entry* rideEntry = get_ride_entry(ride->subtype); if (ride->type != RIDE_TYPE_TOILETS || shopItem != SHOP_ITEM_ADMISSION) { @@ -183,7 +192,5 @@ public: window_invalidate_by_number(WC_RIDE, rideId); } } - - return res; } };