1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-07 07:04:36 +01:00

Fix #17811: Erratic “same price” for photos if gSamePriceThroughoutPark is corrupted

This commit is contained in:
Michael Steenbeek
2022-09-26 19:58:19 +02:00
committed by GitHub
parent 5e89470016
commit 36b775e573

View File

@@ -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);