1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 22:13:07 +01:00

Replace if chain with else ifs

This commit is contained in:
matheusvb3
2025-11-26 01:18:43 -03:00
parent 7b5ab2b007
commit 0c1e78a042

View File

@@ -1715,29 +1715,25 @@ static bool GuestDecideAndBuyItem(Guest& guest, Ride& ride, const ShopItem shopI
}
}
if (shopItemDescriptor.IsFood())
guest.AmountOfFood++;
if (shopItemDescriptor.IsDrink())
guest.AmountOfDrinks++;
if (shopItemDescriptor.IsSouvenir())
guest.AmountOfSouvenirs++;
money64* expend_type = &guest.PaidOnSouvenirs;
ExpenditureType expenditure = ExpenditureType::shopStock;
if (shopItemDescriptor.IsFood())
{
guest.AmountOfFood++;
expend_type = &guest.PaidOnFood;
expenditure = ExpenditureType::foodDrinkStock;
}
if (shopItemDescriptor.IsDrink())
else if (shopItemDescriptor.IsDrink())
{
guest.AmountOfDrinks++;
expend_type = &guest.PaidOnDrink;
expenditure = ExpenditureType::foodDrinkStock;
}
else if (shopItemDescriptor.IsSouvenir())
{
guest.AmountOfSouvenirs++;
}
if (!(gameState.park.flags & PARK_FLAGS_NO_MONEY))
FinancePayment(shopItemDescriptor.Cost, expenditure);