Rename Peep::voucher_type to VoucherType

This commit is contained in:
Tulio Leao 2020-05-30 19:20:20 -03:00
parent bf228abf55
commit fd71b1b009
11 changed files with 18 additions and 18 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);
}

View File

@ -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:

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);