diff --git a/contributors.md b/contributors.md index 30a9a3cfff..f70cbf8ba3 100644 --- a/contributors.md +++ b/contributors.md @@ -147,6 +147,7 @@ The following people are not part of the development team, but have been contrib * Michael Coates (outerwear) * Reid Baris (Rdbaris) * Deanna Baris (dbaris) +* Chaitanya Thengdi (chaitanyathengdi) ## Toolchain * (Balletie) - macOS diff --git a/distribution/changelog.txt b/distribution/changelog.txt index cd5b8128f1..e641405cad 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -48,6 +48,7 @@ - Fix: [#12123] Long server descriptions are not cut off properly. - Fix: [#12211] Map Generator shows incorrect map sizes (e.g. "150 x 0"). - Fix: [#12221] Map Generation tool doesn't place any trees. +- Fix: [#12285] On-ride photo profit assumes every guest buys one. - Fix: [#12312] Softlock when loading save file via command line fails. - Fix: RCT1 scenarios have more items in the object list than are present in the park or the research list. - Improved: [#6530] Allow water and land height changes on park borders. diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index b4bd34ee61..a0238c7384 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -396,8 +396,24 @@ money32 Ride::CalculateIncomePerHour() const if (currentShopItem != SHOP_ITEM_NONE) { - priceMinusCost += price[1]; - priceMinusCost -= ShopItems[currentShopItem].Cost; + const money16 shopItemProfit = price[1] - ShopItems[currentShopItem].Cost; + + if (ShopItems[currentShopItem].IsPhoto()) + { + const int32_t rideTicketsSold = total_customers - no_secondary_items_sold; + + // Use the ratio between photo sold and total admissions to approximate the photo income(as not every guest will buy + // one). + // TODO: use data from the last 5 minutes instead of all-time values for a more accurate calculation + if (rideTicketsSold > 0) + { + priceMinusCost += ((no_secondary_items_sold * shopItemProfit) / rideTicketsSold); + } + } + else + { + priceMinusCost += shopItemProfit; + } if (entry->shop_item[0] != SHOP_ITEM_NONE) priceMinusCost /= 2;