From 36b775e573b7788eb06a3422e42736defb581d47 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Mon, 26 Sep 2022 19:58:19 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20#17811:=20Erratic=20=E2=80=9Csame=20price?= =?UTF-8?q?=E2=80=9D=20for=20photos=20if=20gSamePriceThroughoutPark=20is?= =?UTF-8?q?=20corrupted?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/openrct2-ui/windows/Ride.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index a010beb3d5..9bdb860c24 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -6296,18 +6296,19 @@ static utf8 _moneyInputText[MONEY_STRING_MAXLENGTH]; static void UpdateSamePriceThroughoutFlags(ShopItem shop_item) { - uint64_t newFlags; - if (GetShopItemDescriptor(shop_item).IsPhoto()) { - newFlags = gSamePriceThroughoutPark; - newFlags ^= EnumsToFlags(ShopItem::Photo, ShopItem::Photo2, ShopItem::Photo3, ShopItem::Photo4); + auto newFlags = gSamePriceThroughoutPark; + if (gSamePriceThroughoutPark & EnumToFlag(shop_item)) + newFlags &= ~EnumsToFlags(ShopItem::Photo, ShopItem::Photo2, ShopItem::Photo3, ShopItem::Photo4); + else + newFlags |= EnumsToFlags(ShopItem::Photo, ShopItem::Photo2, ShopItem::Photo3, ShopItem::Photo4); auto parkSetParameter = ParkSetParameterAction(ParkParameter::SamePriceInPark, newFlags); GameActions::Execute(&parkSetParameter); } else { - newFlags = gSamePriceThroughoutPark; + auto newFlags = gSamePriceThroughoutPark; newFlags ^= EnumToFlag(shop_item); auto parkSetParameter = ParkSetParameterAction(ParkParameter::SamePriceInPark, newFlags); GameActions::Execute(&parkSetParameter);