Fix special cases for ride photos when looking up uniform price, fixes #933

This commit is contained in:
Michael Steenbeek 2016-11-28 10:27:42 +01:00 committed by GitHub
parent fc666e707a
commit 30c61345d8
4 changed files with 23 additions and 3 deletions

View File

@ -31,6 +31,7 @@
- Improved: In-game file dialog now shows more formats (sv6, sc6, sv4, etc.)
- Removed: BMP screenshots.
- Removed: Intamin and Phoenix easter eggs.
- Fix: [#933] On-ride photo price sometimes gets reset to £2 when using 'same price in whole park'
- Fix: [#1038] Guest List is out of order.
- Fix: [#1238] Track place window does not fully adjust to custom colour scheme.
- Fix: [#2042] Guests entering queues are immediately annoyed when many entertainers are around (original bug).

View File

@ -5943,12 +5943,23 @@ static money32 shop_item_get_common_price(rct_ride *forRide, int shopItem)
if (rideEntry->shop_item_secondary == shopItem) {
return ride->price_secondary;
}
if (shop_item_is_photo(shopItem) && (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO)) {
return ride->price_secondary;
}
}
}
return MONEY32_UNDEFINED;
}
bool shop_item_is_photo(int shopItem)
{
return (
shopItem == SHOP_ITEM_PHOTO || shopItem == SHOP_ITEM_PHOTO2 ||
shopItem == SHOP_ITEM_PHOTO3 || shopItem == SHOP_ITEM_PHOTO4
);
}
bool shop_item_has_common_price(int shopItem)
{
if (shopItem < 32) {
@ -6177,6 +6188,14 @@ foundRideEntry:
}
}
}
// Set the on-ride photo price. (Whether the ride has one or not.)
if (shop_item_has_common_price(SHOP_ITEM_PHOTO)) {
money32 price = shop_item_get_common_price(ride, SHOP_ITEM_PHOTO);
if (price != MONEY32_UNDEFINED) {
ride->price_secondary = (money16)price;
}
}
}
memset(ride->num_customers, 0, sizeof(ride->num_customers));
@ -6725,8 +6744,7 @@ void game_command_set_ride_price(int *eax, int *ebx, int *ecx, int *edx, int *es
}
// If the shop item is the same or an on-ride photo
if (rideEntry->shop_item_secondary == shop_item ||
(rideEntry->shop_item_secondary == SHOP_ITEM_NONE &&
(shop_item == SHOP_ITEM_PHOTO || shop_item == SHOP_ITEM_PHOTO2 || shop_item == SHOP_ITEM_PHOTO3 || shop_item == SHOP_ITEM_PHOTO4))) {
(rideEntry->shop_item_secondary == SHOP_ITEM_NONE && shop_item_is_photo(shop_item))) {
ride->price_secondary = price;
window_invalidate_by_number(WC_RIDE, rideId);

View File

@ -1053,6 +1053,7 @@ void ride_set_name(int rideIndex, const char *name);
void game_command_set_ride_name(int *eax, int *ebx, int *ecx, int *edx, int *esi, int *edi, int *ebp);
void game_command_set_ride_setting(int *eax, int *ebx, int *ecx, int *edx, int *esi, int *edi, int *ebp);
int ride_get_refund_price(int ride_id);
bool shop_item_is_photo(int shopItem);
bool shop_item_has_common_price(int shopItem);
void game_command_create_ride(int *eax, int *ebx, int *ecx, int *edx, int *esi, int *edi, int *ebp);
void game_command_callback_ride_construct_new(int eax, int ebx, int ecx, int edx, int esi, int edi, int ebp);

View File

@ -5798,7 +5798,7 @@ static void update_same_price_throughout_flags(uint32 shop_item)
{
uint32 newFlags;
if (shop_item == SHOP_ITEM_PHOTO || shop_item == SHOP_ITEM_PHOTO2 || shop_item == SHOP_ITEM_PHOTO3 || shop_item == SHOP_ITEM_PHOTO4) {
if (shop_item_is_photo(shop_item)) {
newFlags = gSamePriceThroughoutParkA;
newFlags ^= (1 << SHOP_ITEM_PHOTO);
game_do_command(0, 1, 0, (0x2 << 8), GAME_COMMAND_SET_PARK_OPEN, newFlags, shop_item);