diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 5806cb458a..98d08a9f54 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -246,7 +246,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots { COMPARE_FIELD(Peep, ride_types_been_on[i]); } - COMPARE_FIELD(Peep, item_extra_flags); + COMPARE_FIELD(Peep, ItemExtraFlags); COMPARE_FIELD(Peep, Photo2RideRef); COMPARE_FIELD(Peep, Photo3RideRef); COMPARE_FIELD(Peep, Photo4RideRef); diff --git a/src/openrct2/actions/RideDemolishAction.hpp b/src/openrct2/actions/RideDemolishAction.hpp index b878b00906..6f4dc1bb64 100644 --- a/src/openrct2/actions/RideDemolishAction.hpp +++ b/src/openrct2/actions/RideDemolishAction.hpp @@ -192,25 +192,25 @@ private: peep->ItemStandardFlags &= ~PEEP_ITEM_PHOTO; } } - if (peep->item_extra_flags & PEEP_ITEM_PHOTO2) + if (peep->ItemExtraFlags & PEEP_ITEM_PHOTO2) { if (peep->Photo2RideRef == _rideIndex) { - peep->item_extra_flags &= ~PEEP_ITEM_PHOTO2; + peep->ItemExtraFlags &= ~PEEP_ITEM_PHOTO2; } } - if (peep->item_extra_flags & PEEP_ITEM_PHOTO3) + if (peep->ItemExtraFlags & PEEP_ITEM_PHOTO3) { if (peep->Photo3RideRef == _rideIndex) { - peep->item_extra_flags &= ~PEEP_ITEM_PHOTO3; + peep->ItemExtraFlags &= ~PEEP_ITEM_PHOTO3; } } - if (peep->item_extra_flags & PEEP_ITEM_PHOTO4) + if (peep->ItemExtraFlags & PEEP_ITEM_PHOTO4) { if (peep->Photo4RideRef == _rideIndex) { - peep->item_extra_flags &= ~PEEP_ITEM_PHOTO4; + peep->ItemExtraFlags &= ~PEEP_ITEM_PHOTO4; } } diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 152c4f7009..f19b7a270e 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -1100,12 +1100,12 @@ void Guest::Tick128UpdateGuest(int32_t index) chosen_food = bitscanforward(HasFoodExtraFlag()); if (chosen_food != -1) { - item_extra_flags &= ~(1 << chosen_food); + ItemExtraFlags &= ~(1 << chosen_food); uint8_t discard_container = peep_extra_item_containers[chosen_food]; if (discard_container != 0xFF) { if (discard_container >= 32) - item_extra_flags |= (1 << (discard_container - 32)); + ItemExtraFlags |= (1 << (discard_container - 32)); else ItemStandardFlags |= (1 << discard_container); } @@ -1323,7 +1323,7 @@ bool Guest::HasItem(int32_t peepItem) const } else { - return item_extra_flags & (1u << (peepItem - 32)); + return ItemExtraFlags & (1u << (peepItem - 32)); } } @@ -1337,7 +1337,7 @@ int32_t Guest::HasFoodStandardFlag() const int32_t Guest::HasFoodExtraFlag() const { - return item_extra_flags + return ItemExtraFlags & (PEEP_ITEM_PRETZEL | PEEP_ITEM_CHOCOLATE | PEEP_ITEM_ICED_TEA | PEEP_ITEM_FUNNEL_CAKE | PEEP_ITEM_BEEF_NOODLES | PEEP_ITEM_FRIED_RICE_NOODLES | PEEP_ITEM_WONTON_SOUP | PEEP_ITEM_MEATBALL_SOUP | PEEP_ITEM_FRUIT_JUICE | PEEP_ITEM_SOYBEAN_MILK | PEEP_ITEM_SU_JONGKWA | PEEP_ITEM_SUB_SANDWICH | PEEP_ITEM_COOKIE @@ -1351,7 +1351,7 @@ bool Guest::HasDrinkStandardFlag() const bool Guest::HasDrinkExtraFlag() const { - return item_extra_flags + return ItemExtraFlags & (PEEP_ITEM_CHOCOLATE | PEEP_ITEM_ICED_TEA | PEEP_ITEM_FRUIT_JUICE | PEEP_ITEM_SOYBEAN_MILK | PEEP_ITEM_SU_JONGKWA); } @@ -1373,7 +1373,7 @@ int32_t Guest::HasEmptyContainerStandardFlag() const int32_t Guest::HasEmptyContainerExtraFlag() const { - return item_extra_flags + return ItemExtraFlags & (PEEP_ITEM_EMPTY_BOWL_RED | PEEP_ITEM_EMPTY_DRINK_CARTON | PEEP_ITEM_EMPTY_JUICE_CUP | PEEP_ITEM_EMPTY_BOWL_BLUE); } @@ -1647,7 +1647,7 @@ loc_69B221: // The peep has now decided to buy the item (or, specifically, has not been // dissuaded so far). if (shopItem >= 32) - item_extra_flags |= (1u << (shopItem - 32)); + ItemExtraFlags |= (1u << (shopItem - 32)); else ItemStandardFlags |= (1u << shopItem); @@ -5346,7 +5346,7 @@ void Guest::UpdateWalking() for (int32_t container = HasEmptyContainerExtraFlag(); pos_extr < 32; pos_extr++) if (container & (1u << pos_extr)) break; - item_extra_flags &= ~(1u << pos_extr); + ItemExtraFlags &= ~(1u << pos_extr); litterType = item_extra_litter[pos_extr]; } @@ -5949,7 +5949,7 @@ void Guest::UpdateUsingBin() // switched to scenario_rand as it is more reliable if ((scenario_rand() & 7) == 0) space_left_in_bin--; - item_extra_flags &= ~(1 << cur_container); + ItemExtraFlags &= ~(1 << cur_container); window_invalidate_flags |= PEEP_INVALIDATE_PEEP_INVENTORY; UpdateSpriteType(); @@ -5961,7 +5961,7 @@ void Guest::UpdateUsingBin() int32_t litterY = y + (scenario_rand() & 7) - 3; litter_create(litterX, litterY, z, scenario_rand() & 3, litterType); - item_extra_flags &= ~(1 << cur_container); + ItemExtraFlags &= ~(1 << cur_container); window_invalidate_flags |= PEEP_INVALIDATE_PEEP_INVENTORY; UpdateSpriteType(); @@ -6894,7 +6894,7 @@ void Guest::UpdateSpriteType() } else { - if (item_extra_flags & item_pref->item) + if (ItemExtraFlags & item_pref->item) { SetSpriteType(item_pref->sprite_type); return; diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index e40eb39d4a..3e6fe834cb 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -1749,7 +1749,7 @@ Peep* Peep::Generate(const CoordsXYZ& coords) peep->PathfindGoal.z = 0xFF; peep->PathfindGoal.direction = INVALID_DIRECTION; peep->ItemStandardFlags = 0; - peep->item_extra_flags = 0; + peep->ItemExtraFlags = 0; peep->GuestHeadingToRideId = RIDE_ID_NULL; peep->LitterCount = 0; peep->DisgustingCount = 0; diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index db1c1deb1c..3d5c760889 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -433,7 +433,7 @@ enum PeepItem PEEP_ITEM_EMPTY_BOX = (1 << 26), PEEP_ITEM_EMPTY_BOTTLE = (1 << 27), - // item_extra_flags + // ItemExtraFlags PEEP_ITEM_PHOTO2 = (1 << 0), PEEP_ITEM_PHOTO3 = (1 << 1), PEEP_ITEM_PHOTO4 = (1 << 2), @@ -631,7 +631,7 @@ struct Peep : SpriteBase uint8_t window_invalidate_flags; money16 paid_on_drink; uint8_t ride_types_been_on[16]; - uint32_t item_extra_flags; + uint32_t ItemExtraFlags; uint8_t Photo2RideRef; uint8_t Photo3RideRef; uint8_t Photo4RideRef; diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index ae46aa80d5..6ef8af5716 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1168,7 +1168,7 @@ void S6Exporter::ExportSpritePeep(RCT2SpritePeep* dst, const Peep* src) { dst->ride_types_been_on[i] = src->ride_types_been_on[i]; } - dst->item_extra_flags = src->item_extra_flags; + dst->item_extra_flags = src->ItemExtraFlags; dst->photo2_ride_ref = src->Photo2RideRef; dst->photo3_ride_ref = src->Photo3RideRef; dst->photo4_ride_ref = src->Photo4RideRef; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index ca30d433da..a37194c7e0 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1433,7 +1433,7 @@ public: { dst->ride_types_been_on[i] = src->ride_types_been_on[i]; } - dst->item_extra_flags = src->item_extra_flags; + dst->ItemExtraFlags = src->item_extra_flags; dst->Photo2RideRef = src->photo2_ride_ref; dst->Photo3RideRef = src->photo3_ride_ref; dst->Photo4RideRef = src->photo4_ride_ref; diff --git a/test/tests/S6ImportExportTests.cpp b/test/tests/S6ImportExportTests.cpp index 629961a8af..0de6b998b4 100644 --- a/test/tests/S6ImportExportTests.cpp +++ b/test/tests/S6ImportExportTests.cpp @@ -190,7 +190,7 @@ static void CompareSpriteDataPeep(const Peep& left, const Peep& right) { COMPARE_FIELD(ride_types_been_on[i]); } - COMPARE_FIELD(item_extra_flags); + COMPARE_FIELD(ItemExtraFlags); COMPARE_FIELD(Photo2RideRef); COMPARE_FIELD(Photo3RideRef); COMPARE_FIELD(Photo4RideRef);