mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #1888 from Gymnasiast/fix-1877
Take on-ride photos into account when calculating profit per hour, fixes #1877
This commit is contained in:
commit
18bb8b9bb0
|
@ -246,7 +246,7 @@ money32 ride_calculate_income_per_hour(rct_ride *ride)
|
||||||
{
|
{
|
||||||
rct_ride_type *entry;
|
rct_ride_type *entry;
|
||||||
money32 incomePerHour, priceMinusCost;
|
money32 incomePerHour, priceMinusCost;
|
||||||
int shopItem;
|
int currentShopItem;
|
||||||
|
|
||||||
entry = GET_RIDE_ENTRY(ride->subtype);
|
entry = GET_RIDE_ENTRY(ride->subtype);
|
||||||
incomePerHour =
|
incomePerHour =
|
||||||
|
@ -263,16 +263,21 @@ money32 ride_calculate_income_per_hour(rct_ride *ride)
|
||||||
incomePerHour *= 12;
|
incomePerHour *= 12;
|
||||||
priceMinusCost = ride->price;
|
priceMinusCost = ride->price;
|
||||||
|
|
||||||
shopItem = entry->shop_item;
|
currentShopItem = entry->shop_item;
|
||||||
if (shopItem != 255) {
|
if (currentShopItem != 255) {
|
||||||
priceMinusCost -= get_shop_item_cost(shopItem);
|
priceMinusCost -= get_shop_item_cost(currentShopItem);
|
||||||
|
}
|
||||||
|
|
||||||
shopItem = entry->shop_item_secondary;
|
currentShopItem = ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO ?
|
||||||
if (shopItem != 255) {
|
RCT2_GLOBAL(0x0097D7CB + (ride->type * 4), uint8) :
|
||||||
priceMinusCost += ride->price_secondary;
|
entry->shop_item_secondary;
|
||||||
priceMinusCost -= get_shop_item_cost(shopItem);
|
|
||||||
|
if (currentShopItem != 255) {
|
||||||
|
priceMinusCost += ride->price_secondary;
|
||||||
|
priceMinusCost -= get_shop_item_cost(currentShopItem);
|
||||||
|
|
||||||
|
if(entry->shop_item!=255)
|
||||||
priceMinusCost /= 2;
|
priceMinusCost /= 2;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
incomePerHour *= priceMinusCost;
|
incomePerHour *= priceMinusCost;
|
||||||
|
|
Loading…
Reference in New Issue