diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 207719d8f7..7d59e1f424 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -1955,7 +1955,7 @@ static rct_string_id window_guest_inventory_format_item(Peep* peep, int32_t item set_format_arg(0, uint32_t, SPRITE_ID_PALETTE_COLOUR_1(peep->UmbrellaColour) | ShopItems[item].Image); break; case SHOP_ITEM_VOUCHER: - switch (peep->voucher_type) + switch (peep->VoucherType) { case VOUCHER_TYPE_PARK_ENTRY_FREE: set_format_arg(6, rct_string_id, STR_PEEP_INVENTORY_VOUCHER_PARK_ENTRY_FREE); diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index e607fd90a7..e985a6bd9b 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -302,7 +302,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(Peep, no_of_drinks); COMPARE_FIELD(Peep, no_of_souvenirs); COMPARE_FIELD(Peep, vandalism_seen); - COMPARE_FIELD(Peep, voucher_type); + COMPARE_FIELD(Peep, VoucherType); COMPARE_FIELD(Peep, VoucherArguments); COMPARE_FIELD(Peep, SurroundingsThoughtTimeout); COMPARE_FIELD(Peep, Angriness); diff --git a/src/openrct2/actions/RideDemolishAction.hpp b/src/openrct2/actions/RideDemolishAction.hpp index f5afd18462..7aa53e15df 100644 --- a/src/openrct2/actions/RideDemolishAction.hpp +++ b/src/openrct2/actions/RideDemolishAction.hpp @@ -178,7 +178,7 @@ private: // remove any free voucher for this ride from peep if (peep->ItemStandardFlags & PEEP_ITEM_VOUCHER) { - if (peep->voucher_type == VOUCHER_TYPE_RIDE_FREE && peep->VoucherArguments == _rideIndex) + if (peep->VoucherType == VOUCHER_TYPE_RIDE_FREE && peep->VoucherArguments == _rideIndex) { peep->ItemStandardFlags &= ~(PEEP_ITEM_VOUCHER); } diff --git a/src/openrct2/management/Marketing.cpp b/src/openrct2/management/Marketing.cpp index cfc1ad8886..a8c54304dc 100644 --- a/src/openrct2/management/Marketing.cpp +++ b/src/openrct2/management/Marketing.cpp @@ -136,22 +136,22 @@ void marketing_set_guest_campaign(Peep* peep, int32_t campaignType) { case ADVERTISING_CAMPAIGN_PARK_ENTRY_FREE: peep->ItemStandardFlags |= PEEP_ITEM_VOUCHER; - peep->voucher_type = VOUCHER_TYPE_PARK_ENTRY_FREE; + peep->VoucherType = VOUCHER_TYPE_PARK_ENTRY_FREE; break; case ADVERTISING_CAMPAIGN_RIDE_FREE: peep->ItemStandardFlags |= PEEP_ITEM_VOUCHER; - peep->voucher_type = VOUCHER_TYPE_RIDE_FREE; + peep->VoucherType = VOUCHER_TYPE_RIDE_FREE; peep->VoucherArguments = campaign->RideId; peep->guest_heading_to_ride_id = campaign->RideId; peep->peep_is_lost_countdown = 240; break; case ADVERTISING_CAMPAIGN_PARK_ENTRY_HALF_PRICE: peep->ItemStandardFlags |= PEEP_ITEM_VOUCHER; - peep->voucher_type = VOUCHER_TYPE_PARK_ENTRY_HALF_PRICE; + peep->VoucherType = VOUCHER_TYPE_PARK_ENTRY_HALF_PRICE; break; case ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE: peep->ItemStandardFlags |= PEEP_ITEM_VOUCHER; - peep->voucher_type = VOUCHER_TYPE_FOOD_OR_DRINK_FREE; + peep->VoucherType = VOUCHER_TYPE_FOOD_OR_DRINK_FREE; peep->VoucherArguments = campaign->ShopItemType; break; case ADVERTISING_CAMPAIGN_PARK: diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index ce24c9e8a8..2191f2062d 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -1481,7 +1481,7 @@ bool Guest::DecideAndBuyItem(Ride* ride, int32_t shopItem, money32 price) bool hasVoucher = false; - if ((ItemStandardFlags & PEEP_ITEM_VOUCHER) && (voucher_type == VOUCHER_TYPE_FOOD_OR_DRINK_FREE) + if ((ItemStandardFlags & PEEP_ITEM_VOUCHER) && (VoucherType == VOUCHER_TYPE_FOOD_OR_DRINK_FREE) && (VoucherArguments == shopItem)) { hasVoucher = true; @@ -2413,7 +2413,7 @@ void Guest::ReadMap() static bool peep_has_voucher_for_free_ride(Peep* peep, Ride* ride) { - return peep->ItemStandardFlags & PEEP_ITEM_VOUCHER && peep->voucher_type == VOUCHER_TYPE_RIDE_FREE + return peep->ItemStandardFlags & PEEP_ITEM_VOUCHER && peep->VoucherType == VOUCHER_TYPE_RIDE_FREE && peep->VoucherArguments == ride->id; } @@ -2634,7 +2634,7 @@ static void peep_update_ride_at_entrance_try_leave(Guest* peep) static bool peep_check_ride_price_at_entrance(Guest* peep, Ride* ride, money32 ridePrice) { - if ((peep->ItemStandardFlags & PEEP_ITEM_VOUCHER) && peep->voucher_type == VOUCHER_TYPE_RIDE_FREE + if ((peep->ItemStandardFlags & PEEP_ITEM_VOUCHER) && peep->VoucherType == VOUCHER_TYPE_RIDE_FREE && peep->VoucherArguments == peep->current_ride) return true; @@ -3857,7 +3857,7 @@ void Guest::UpdateRideFreeVehicleEnterRide(Ride* ride) money16 ridePrice = ride_get_price(ride); if (ridePrice != 0) { - if ((ItemStandardFlags & PEEP_ITEM_VOUCHER) && (voucher_type == VOUCHER_TYPE_RIDE_FREE) + if ((ItemStandardFlags & PEEP_ITEM_VOUCHER) && (VoucherType == VOUCHER_TYPE_RIDE_FREE) && (VoucherArguments == current_ride)) { ItemStandardFlags &= ~PEEP_ITEM_VOUCHER; diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index d20ae7f671..849984757f 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -2603,13 +2603,13 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl { if (peep->ItemStandardFlags & PEEP_ITEM_VOUCHER) { - if (peep->voucher_type == VOUCHER_TYPE_PARK_ENTRY_HALF_PRICE) + if (peep->VoucherType == VOUCHER_TYPE_PARK_ENTRY_HALF_PRICE) { entranceFee /= 2; peep->ItemStandardFlags &= ~PEEP_ITEM_VOUCHER; peep->window_invalidate_flags |= PEEP_INVALIDATE_PEEP_INVENTORY; } - else if (peep->voucher_type == VOUCHER_TYPE_PARK_ENTRY_FREE) + else if (peep->VoucherType == VOUCHER_TYPE_PARK_ENTRY_FREE) { entranceFee = 0; peep->ItemStandardFlags &= ~PEEP_ITEM_VOUCHER; diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index 593774d260..5112ec947a 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -736,7 +736,7 @@ struct Peep : SpriteBase uint8_t no_of_drinks; uint8_t no_of_souvenirs; uint8_t vandalism_seen; // 0xC0 vandalism thought timeout, 0x3F vandalism tiles seen - uint8_t voucher_type; + uint8_t VoucherType; uint8_t VoucherArguments; // ride_id or string_offset_id uint8_t SurroundingsThoughtTimeout; uint8_t Angriness; diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 2dacfe512f..1d0dbfc5b9 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1495,7 +1495,7 @@ private: dst->paid_on_souvenirs = src->paid_on_souvenirs; dst->VoucherArguments = src->voucher_arguments; - dst->voucher_type = src->voucher_type; + dst->VoucherType = src->voucher_type; dst->SurroundingsThoughtTimeout = src->surroundings_thought_timeout; dst->Angriness = src->angriness; diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 7bd0e9ee99..8b6afa371b 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1229,7 +1229,7 @@ void S6Exporter::ExportSpritePeep(RCT2SpritePeep* dst, const Peep* src) dst->no_of_drinks = src->no_of_drinks; dst->no_of_souvenirs = src->no_of_souvenirs; dst->vandalism_seen = src->vandalism_seen; - dst->voucher_type = src->voucher_type; + dst->voucher_type = src->VoucherType; dst->voucher_arguments = src->VoucherArguments; dst->surroundings_thought_timeout = src->SurroundingsThoughtTimeout; dst->angriness = src->Angriness; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 57d9077a02..509b33ea7d 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1494,7 +1494,7 @@ public: dst->no_of_drinks = src->no_of_drinks; dst->no_of_souvenirs = src->no_of_souvenirs; dst->vandalism_seen = src->vandalism_seen; - dst->voucher_type = src->voucher_type; + dst->VoucherType = src->voucher_type; dst->VoucherArguments = src->voucher_arguments; dst->SurroundingsThoughtTimeout = src->surroundings_thought_timeout; dst->Angriness = src->angriness; diff --git a/test/tests/S6ImportExportTests.cpp b/test/tests/S6ImportExportTests.cpp index e9278ad4c0..362420b247 100644 --- a/test/tests/S6ImportExportTests.cpp +++ b/test/tests/S6ImportExportTests.cpp @@ -255,7 +255,7 @@ static void CompareSpriteDataPeep(const Peep& left, const Peep& right) COMPARE_FIELD(no_of_drinks); COMPARE_FIELD(no_of_souvenirs); COMPARE_FIELD(vandalism_seen); - COMPARE_FIELD(voucher_type); + COMPARE_FIELD(VoucherType); COMPARE_FIELD(VoucherArguments); COMPARE_FIELD(SurroundingsThoughtTimeout); COMPARE_FIELD(Angriness);