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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user