diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index 1bb91f057a..c17aad3e4a 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -452,7 +452,7 @@ void game_fix_save_vars() if (peep->CurrentRideStation >= MAX_STATIONS) { const uint8_t srcStation = peep->CurrentRideStation; - const uint8_t rideIdx = peep->current_ride; + const uint8_t rideIdx = peep->CurrentRide; if (rideIdx == RIDE_ID_NULL) { continue; @@ -461,7 +461,7 @@ void game_fix_save_vars() if (ride == nullptr) { log_warning("Couldn't find ride %u, resetting ride on peep %u", rideIdx, spriteIndex); - peep->current_ride = RIDE_ID_NULL; + peep->CurrentRide = RIDE_ID_NULL; continue; } auto ft = Formatter::Common(); diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index fdea80c70d..d66fa7676b 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -250,7 +250,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(Peep, photo2_ride_ref); COMPARE_FIELD(Peep, photo3_ride_ref); COMPARE_FIELD(Peep, photo4_ride_ref); - COMPARE_FIELD(Peep, current_ride); + COMPARE_FIELD(Peep, CurrentRide); COMPARE_FIELD(Peep, CurrentRideStation); COMPARE_FIELD(Peep, CurrentTrain); COMPARE_FIELD(Peep, TimeToSitdown); diff --git a/src/openrct2/actions/RideDemolishAction.hpp b/src/openrct2/actions/RideDemolishAction.hpp index afd8fad2af..4b225bfba6 100644 --- a/src/openrct2/actions/RideDemolishAction.hpp +++ b/src/openrct2/actions/RideDemolishAction.hpp @@ -164,9 +164,9 @@ private: peep->RidesBeenOn[ride_id_offset] &= ~(1 << ride_id_bit); if (peep->state == PEEP_STATE_WATCHING) { - if (peep->current_ride == _rideIndex) + if (peep->CurrentRide == _rideIndex) { - peep->current_ride = RIDE_ID_NULL; + peep->CurrentRide = RIDE_ID_NULL; if (peep->TimeToStand >= 50) { // make peep stop watching the ride diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index e40a0c48dc..8a01d3edba 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -689,7 +689,7 @@ viewport_focus viewport_update_smart_guest_follow(rct_window* window, Peep* peep if (peep->state == PEEP_STATE_ON_RIDE || peep->state == PEEP_STATE_ENTERING_RIDE || (peep->state == PEEP_STATE_LEAVING_RIDE && peep->x == LOCATION_NULL)) { - auto ride = get_ride(peep->current_ride); + auto ride = get_ride(peep->CurrentRide); if (ride != nullptr && (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) { auto train = GET_VEHICLE(ride->vehicles[peep->CurrentTrain]); @@ -706,7 +706,7 @@ viewport_focus viewport_update_smart_guest_follow(rct_window* window, Peep* peep } if (peep->x == LOCATION_NULL && overallFocus) { - auto ride = get_ride(peep->current_ride); + auto ride = get_ride(peep->CurrentRide); if (ride != nullptr) { auto xy = ride->overall_view.ToTileCentre(); diff --git a/src/openrct2/management/NewsItem.cpp b/src/openrct2/management/NewsItem.cpp index 1e545f3b52..4d8366bf8f 100644 --- a/src/openrct2/management/NewsItem.cpp +++ b/src/openrct2/management/NewsItem.cpp @@ -249,7 +249,7 @@ std::optional news_item_get_subject_location(int32_t type, int32_t su } // Find which ride peep is on - Ride* ride = get_ride(peep->current_ride); + Ride* ride = get_ride(peep->CurrentRide); if (ride == nullptr || !(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) { subjectLoc = std::nullopt; diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 1d52770647..50466fce10 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -789,14 +789,14 @@ void Guest::Tick128UpdateGuest(int32_t index) if (GuestTimeOnRide > 22) { - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride != nullptr) { PeepThoughtType thought_type = ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IN_RIDE) ? PEEP_THOUGHT_TYPE_GET_OUT : PEEP_THOUGHT_TYPE_GET_OFF; - InsertNewThought(thought_type, current_ride); + InsertNewThought(thought_type, CurrentRide); } } } @@ -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->VoucherType == VOUCHER_TYPE_RIDE_FREE - && peep->VoucherArguments == peep->current_ride) + && peep->VoucherArguments == peep->CurrentRide) return true; if (peep->CashInPocket <= 0 && !(gParkFlags & PARK_FLAGS_NO_MONEY)) @@ -2646,7 +2646,7 @@ static bool peep_check_ride_price_at_entrance(Guest* peep, Ride* ride, money32 r if (ridePrice > peep->CashInPocket) { - peep->InsertNewThought(PEEP_THOUGHT_TYPE_CANT_AFFORD_0, peep->current_ride); + peep->InsertNewThought(PEEP_THOUGHT_TYPE_CANT_AFFORD_0, peep->CurrentRide); peep_update_ride_at_entrance_try_leave(peep); return false; } @@ -2656,7 +2656,7 @@ static bool peep_check_ride_price_at_entrance(Guest* peep, Ride* ride, money32 r { if (value * 2 < ridePrice) { - peep->InsertNewThought(PEEP_THOUGHT_TYPE_BAD_VALUE, peep->current_ride); + peep->InsertNewThought(PEEP_THOUGHT_TYPE_BAD_VALUE, peep->CurrentRide); peep_update_ride_at_entrance_try_leave(peep); return false; } @@ -2692,7 +2692,7 @@ static int16_t peep_calculate_ride_satisfaction(Guest* peep, Ride* ride) if (peep->HasRiddenRideType(ride->type)) satisfaction += 10; - if (peep->HasRidden(get_ride(peep->current_ride))) + if (peep->HasRidden(get_ride(peep->CurrentRide))) satisfaction += 10; return satisfaction; @@ -3353,7 +3353,7 @@ void Guest::UpdateBuying() if (!CheckForPath()) return; - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride == nullptr || ride->status != RIDE_STATUS_OPEN) { SetState(PEEP_STATE_FALLING); @@ -3371,7 +3371,7 @@ void Guest::UpdateBuying() if (ride->type == RIDE_TYPE_CASH_MACHINE) { - if (current_ride != PreviousRide) + if (CurrentRide != PreviousRide) { CashInPocket += MONEY(50, 00); } @@ -3388,14 +3388,14 @@ void Guest::UpdateBuying() bool item_bought = false; - if (current_ride != PreviousRide) + if (CurrentRide != PreviousRide) { if (ride->type == RIDE_TYPE_CASH_MACHINE) { - item_bought = peep_should_use_cash_machine(this, current_ride); + item_bought = peep_should_use_cash_machine(this, CurrentRide); if (!item_bought) { - PreviousRide = current_ride; + PreviousRide = CurrentRide; PreviousRideTimeOut = 0; } else @@ -3459,7 +3459,7 @@ void Guest::UpdateBuying() */ void Guest::UpdateRideAtEntrance() { - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride == nullptr) return; @@ -3562,7 +3562,7 @@ static void peep_update_ride_leave_entrance_maze(Guest* peep, Ride* ride, Coords peep->destination_tolerance = 3; ride->cur_num_customers++; - peep->OnEnterRide(peep->current_ride); + peep->OnEnterRide(peep->CurrentRide); peep->sub_state = PEEP_RIDE_MAZE_PATHFINDING; } @@ -3583,7 +3583,7 @@ static void peep_update_ride_leave_entrance_spiral_slide(Guest* peep, Ride* ride peep->CurrentCar = 0; ride->cur_num_customers++; - peep->OnEnterRide(peep->current_ride); + peep->OnEnterRide(peep->CurrentRide); peep->sub_state = PEEP_RIDE_APPROACH_SPIRAL_SLIDE; } @@ -3652,7 +3652,7 @@ static void peep_update_ride_leave_entrance_waypoints(Peep* peep, Ride* ride) */ void Guest::UpdateRideAdvanceThroughEntrance() { - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride == nullptr) return; @@ -3719,7 +3719,7 @@ void Guest::UpdateRideAdvanceThroughEntrance() ride->FormatNameTo(ft); if (gConfigNotifications.ride_warnings) { - news_item_add_to_queue(NEWS_ITEM_RIDE, STR_GUESTS_GETTING_STUCK_ON_RIDE, current_ride); + news_item_add_to_queue(NEWS_ITEM_RIDE, STR_GUESTS_GETTING_STUCK_ON_RIDE, CurrentRide); } } @@ -3857,7 +3857,7 @@ void Guest::UpdateRideFreeVehicleEnterRide(Ride* ride) if (ridePrice != 0) { if ((ItemStandardFlags & PEEP_ITEM_VOUCHER) && (VoucherType == VOUCHER_TYPE_RIDE_FREE) - && (VoucherArguments == current_ride)) + && (VoucherArguments == CurrentRide)) { ItemStandardFlags &= ~PEEP_ITEM_VOUCHER; window_invalidate_flags |= PEEP_INVALIDATE_PEEP_INVENTORY; @@ -3879,7 +3879,7 @@ void Guest::UpdateRideFreeVehicleEnterRide(Ride* ride) if (queueTime != ride->stations[CurrentRideStation].QueueTime) { ride->stations[CurrentRideStation].QueueTime = queueTime; - window_invalidate_by_number(WC_RIDE, current_ride); + window_invalidate_by_number(WC_RIDE, CurrentRide); } if (PeepFlags & PEEP_FLAGS_TRACKING) @@ -3941,7 +3941,7 @@ static void peep_update_ride_no_free_vehicle_rejoin_queue(Peep* peep, Ride* ride */ void Guest::UpdateRideFreeVehicleCheck() { - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride == nullptr) return; @@ -4046,7 +4046,7 @@ void Guest::UpdateRideApproachVehicle() void Guest::UpdateRideEnterVehicle() { - auto* ride = get_ride(current_ride); + auto* ride = get_ride(CurrentRide); if (ride != nullptr) { auto* vehicle = GET_VEHICLE(ride->vehicles[CurrentTrain]); @@ -4080,7 +4080,7 @@ void Guest::UpdateRideEnterVehicle() seatedPeepAsGuest->SetState(PEEP_STATE_ON_RIDE); seatedPeepAsGuest->GuestTimeOnRide = 0; seatedPeepAsGuest->sub_state = PEEP_RIDE_ON_RIDE; - seatedPeepAsGuest->OnEnterRide(current_ride); + seatedPeepAsGuest->OnEnterRide(CurrentRide); } } @@ -4096,7 +4096,7 @@ void Guest::UpdateRideEnterVehicle() GuestTimeOnRide = 0; sub_state = PEEP_RIDE_ON_RIDE; - OnEnterRide(current_ride); + OnEnterRide(CurrentRide); } } } @@ -4107,7 +4107,7 @@ void Guest::UpdateRideEnterVehicle() */ void Guest::UpdateRideLeaveVehicle() { - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride == nullptr) return; @@ -4311,7 +4311,7 @@ void Guest::UpdateRideLeaveVehicle() */ static void peep_update_ride_prepare_for_exit(Peep* peep) { - auto ride = get_ride(peep->current_ride); + auto ride = get_ride(peep->CurrentRide); if (ride == nullptr || peep->CurrentRideStation >= std::size(ride->stations)) return; @@ -4373,7 +4373,7 @@ void Guest::UpdateRideApproachExit() */ void Guest::UpdateRideInExit() { - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride == nullptr) return; @@ -4411,7 +4411,7 @@ void Guest::UpdateRideInExit() */ void Guest::UpdateRideApproachVehicleWaypoints() { - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride == nullptr) return; @@ -4487,7 +4487,7 @@ void Guest::UpdateRideApproachVehicleWaypoints() */ void Guest::UpdateRideApproachExitWaypoints() { - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride == nullptr) return; @@ -4582,7 +4582,7 @@ void Guest::UpdateRideApproachExitWaypoints() */ void Guest::UpdateRideApproachSpiralSlide() { - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride == nullptr) return; @@ -4667,7 +4667,7 @@ static constexpr const CoordsXY _SpiralSlideEndWaypoint[] = { */ void Guest::UpdateRideOnSpiralSlide() { - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride == nullptr || ride->type != RIDE_TYPE_SPIRAL_SLIDE) return; @@ -4750,7 +4750,7 @@ void Guest::UpdateRideLeaveSpiralSlide() return; } - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride == nullptr) return; @@ -4825,7 +4825,7 @@ void Guest::UpdateRideMazePathfinding() return; } - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride == nullptr) return; @@ -4975,7 +4975,7 @@ void Guest::UpdateRideMazePathfinding() */ void Guest::UpdateRideLeaveExit() { - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (auto loc = UpdateAction()) { @@ -4986,7 +4986,7 @@ void Guest::UpdateRideLeaveExit() return; } - OnExitRide(current_ride); + OnExitRide(CurrentRide); if (ride != nullptr && (PeepFlags & PEEP_FLAGS_TRACKING)) { @@ -5047,7 +5047,7 @@ void Guest::UpdateRideShopApproach() */ void Guest::UpdateRideShopInteract() { - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride == nullptr) return; @@ -5115,7 +5115,7 @@ void Guest::UpdateRideShopLeave() //#11758 Previously SetState(PEEP_STATE_WALKING) caused Peeps to double-back to exit point of shop SetState(PEEP_STATE_FALLING); - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride != nullptr) { ride->total_customers++; @@ -5505,7 +5505,7 @@ void Guest::UpdateWalking() for (; !(positions_free & (1 << chosen_position));) chosen_position = (chosen_position + 1) & 3; - current_ride = ride_to_view; + CurrentRide = ride_to_view; CurrentSeat = ride_seat_to_view; var_37 = chosen_edge | (chosen_position << 2); @@ -5523,7 +5523,7 @@ void Guest::UpdateWalking() { InsertNewThought(PEEP_THOUGHT_TYPE_NEW_RIDE, PEEP_THOUGHT_ITEM_NONE); } - if (current_ride == RIDE_ID_NULL) + if (CurrentRide == RIDE_ID_NULL) { InsertNewThought(PEEP_THOUGHT_TYPE_SCENERY, PEEP_THOUGHT_ITEM_NONE); } @@ -5540,7 +5540,7 @@ void Guest::UpdateQueuing() RemoveFromQueue(); return; } - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride == nullptr || ride->status != RIDE_STATUS_OPEN) { RemoveFromQueue(); @@ -5599,7 +5599,7 @@ void Guest::UpdateQueuing() if (TimeInQueue >= 3500 && (0xFFFF & scenario_rand()) <= 93) { // Create the I have been waiting in line ages thought - InsertNewThought(PEEP_THOUGHT_TYPE_QUEUING_AGES, current_ride); + InsertNewThought(PEEP_THOUGHT_TYPE_QUEUING_AGES, CurrentRide); } } else diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index 2f2b202050..092c7f0173 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -1646,9 +1646,9 @@ static int32_t guest_path_find_leaving_park(Peep* peep, uint8_t edges) static int32_t guest_path_find_park_entrance(Peep* peep, uint8_t edges) { // If entrance no longer exists, choose a new one - if ((peep->PeepFlags & PEEP_FLAGS_PARK_ENTRANCE_CHOSEN) && peep->current_ride >= gParkEntrances.size()) + if ((peep->PeepFlags & PEEP_FLAGS_PARK_ENTRANCE_CHOSEN) && peep->CurrentRide >= gParkEntrances.size()) { - peep->current_ride = 0xFF; + peep->CurrentRide = 0xFF; peep->PeepFlags &= ~(PEEP_FLAGS_PARK_ENTRANCE_CHOSEN); } @@ -1671,11 +1671,11 @@ static int32_t guest_path_find_park_entrance(Peep* peep, uint8_t edges) if (chosenEntrance == 0xFF) return guest_path_find_aimless(peep, edges); - peep->current_ride = chosenEntrance; + peep->CurrentRide = chosenEntrance; peep->PeepFlags |= PEEP_FLAGS_PARK_ENTRANCE_CHOSEN; } - const auto& entrance = gParkEntrances[peep->current_ride]; + const auto& entrance = gParkEntrances[peep->CurrentRide]; gPeepPathFindGoalPosition = TileCoordsXYZ(entrance); gPeepPathFindIgnoreForeignQueues = true; diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 30dd7c6674..605166f7d6 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -680,7 +680,7 @@ void peep_decrement_num_riders(Peep* peep) { if (peep->state == PEEP_STATE_ON_RIDE || peep->state == PEEP_STATE_ENTERING_RIDE) { - auto ride = get_ride(peep->current_ride); + auto ride = get_ride(peep->CurrentRide); if (ride != nullptr) { ride->num_riders = std::max(0, ride->num_riders - 1); @@ -704,7 +704,7 @@ void peep_window_state_update(Peep* peep) { if (peep->state == PEEP_STATE_ON_RIDE || peep->state == PEEP_STATE_ENTERING_RIDE) { - auto ride = get_ride(peep->current_ride); + auto ride = get_ride(peep->CurrentRide); if (ride != nullptr) { ride->num_riders++; @@ -1803,7 +1803,7 @@ void Peep::FormatActionTo(void* argsV) const case PEEP_STATE_LEAVING_RIDE: case PEEP_STATE_ENTERING_RIDE: { - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride != nullptr) { ft.Add(ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IN_RIDE) ? STR_IN_RIDE : STR_ON_RIDE); @@ -1818,7 +1818,7 @@ void Peep::FormatActionTo(void* argsV) const case PEEP_STATE_BUYING: { ft.Add(STR_AT_RIDE); - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride != nullptr) { ride->FormatNameTo(ft.Buf()); @@ -1848,7 +1848,7 @@ void Peep::FormatActionTo(void* argsV) const case PEEP_STATE_QUEUING_FRONT: case PEEP_STATE_QUEUING: { - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride != nullptr) { ft.Add(STR_QUEUING_FOR); @@ -1860,9 +1860,9 @@ void Peep::FormatActionTo(void* argsV) const ft.Add(STR_SITTING); break; case PEEP_STATE_WATCHING: - if (current_ride != RIDE_ID_NULL) + if (CurrentRide != RIDE_ID_NULL) { - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride != nullptr) { ft.Add((CurrentSeat & 0x1) ? STR_WATCHING_CONSTRUCTION_OF : STR_WATCHING_RIDE); @@ -1906,7 +1906,7 @@ void Peep::FormatActionTo(void* argsV) const else { ft.Add(STR_RESPONDING_TO_RIDE_BREAKDOWN_CALL); - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride != nullptr) { ride->FormatNameTo(ft.Buf()); @@ -1920,7 +1920,7 @@ void Peep::FormatActionTo(void* argsV) const case PEEP_STATE_FIXING: { ft.Add(STR_FIXING_RIDE); - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride != nullptr) { ride->FormatNameTo(ft.Buf()); @@ -1934,7 +1934,7 @@ void Peep::FormatActionTo(void* argsV) const case PEEP_STATE_HEADING_TO_INSPECTION: { ft.Add(STR_HEADING_TO_RIDE_FOR_INSPECTION); - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride != nullptr) { ride->FormatNameTo(ft.Buf()); @@ -1948,7 +1948,7 @@ void Peep::FormatActionTo(void* argsV) const case PEEP_STATE_INSPECTING: { ft.Add(STR_INSPECTING_RIDE); - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride != nullptr) { ride->FormatNameTo(ft.Buf()); @@ -2423,7 +2423,7 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl peep->GuestNextInQueue = previous_last; ride->stations[stationNum].QueueLength++; - peep->current_ride = rideIndex; + peep->CurrentRide = rideIndex; peep->CurrentRideStation = stationNum; peep->DaysInQueue = 0; peep->SetState(PEEP_STATE_QUEUING); @@ -2813,7 +2813,7 @@ static void peep_interact_with_path(Peep* peep, int16_t x, int16_t y, TileElemen // Check if this queue is connected to the ride the // peep is queuing for, i.e. the player hasn't edited // the queue, rebuilt the ride, etc. - if (peep->current_ride == rideIndex) + if (peep->CurrentRide == rideIndex) { peep_footpath_move_forward(peep, x, y, tile_element, vandalism_present); } @@ -2852,7 +2852,7 @@ static void peep_interact_with_path(Peep* peep, int16_t x, int16_t y, TileElemen ride->stations[stationNum].QueueLength++; peep_decrement_num_riders(peep); - peep->current_ride = rideIndex; + peep->CurrentRide = rideIndex; peep->CurrentRideStation = stationNum; peep->state = PEEP_STATE_QUEUING; peep->DaysInQueue = 0; @@ -2962,7 +2962,7 @@ static bool peep_interact_with_shop(Peep* peep, int16_t x, int16_t y, TileElemen peep->destination_y = (y & 0xFFE0) + 16; peep->destination_tolerance = 3; - peep->current_ride = rideIndex; + peep->CurrentRide = rideIndex; peep->SetState(PEEP_STATE_ENTERING_RIDE); peep->sub_state = PEEP_SHOP_APPROACH; @@ -2987,7 +2987,7 @@ static bool peep_interact_with_shop(Peep* peep, int16_t x, int16_t y, TileElemen peep->GuestHeadingToRideId = 0xFF; peep->ActionSpriteImageOffset = _unk_F1AEF0; peep->SetState(PEEP_STATE_BUYING); - peep->current_ride = rideIndex; + peep->CurrentRide = rideIndex; peep->sub_state = 0; } @@ -3401,7 +3401,7 @@ static void peep_release_balloon(Guest* peep, int16_t spawn_height) */ void Peep::RemoveFromQueue() { - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride == nullptr) return; diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index c204b002a0..d6b0aeedb7 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -635,7 +635,7 @@ struct Peep : SpriteBase uint8_t photo2_ride_ref; uint8_t photo3_ride_ref; uint8_t photo4_ride_ref; - uint8_t current_ride; + uint8_t CurrentRide; StationIndex CurrentRideStation; uint8_t CurrentTrain; union diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index 454413021c..9aff3a6dfd 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -745,7 +745,7 @@ static uint8_t staff_mechanic_direction_surface(Peep* peep) { uint8_t direction = scenario_rand() & 3; - auto ride = get_ride(peep->current_ride); + auto ride = get_ride(peep->CurrentRide); if (ride != nullptr && (peep->state == PEEP_STATE_ANSWERING || peep->state == PEEP_STATE_HEADING_TO_INSPECTION) && (scenario_rand() & 1)) { @@ -838,7 +838,7 @@ static uint8_t staff_mechanic_direction_path(Peep* peep, uint8_t validDirections pathDirections |= (1 << direction); // Mechanic is heading to ride (either broken down or for inspection). - auto ride = get_ride(peep->current_ride); + auto ride = get_ride(peep->CurrentRide); if (ride != nullptr && (peep->state == PEEP_STATE_ANSWERING || peep->state == PEEP_STATE_HEADING_TO_INSPECTION)) { /* Find location of the exit for the target ride station @@ -1422,7 +1422,7 @@ void Staff::UpdateSweeping() */ void Staff::UpdateHeadingToInspect() { - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride == nullptr) { SetState(PEEP_STATE_FALLING); @@ -1474,7 +1474,7 @@ void Staff::UpdateHeadingToInspect() return; } - if (current_ride != rideEntranceExitElement->AsEntrance()->GetRideIndex()) + if (CurrentRide != rideEntranceExitElement->AsEntrance()->GetRideIndex()) return; uint8_t exit_index = rideEntranceExitElement->AsEntrance()->GetStationIndex(); @@ -1529,7 +1529,7 @@ void Staff::UpdateHeadingToInspect() */ void Staff::UpdateAnswering() { - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride == nullptr || ride->mechanic_status != RIDE_MECHANIC_STATUS_HEADING) { SetState(PEEP_STATE_FALLING); @@ -1585,7 +1585,7 @@ void Staff::UpdateAnswering() return; } - if (current_ride != rideEntranceExitElement->AsEntrance()->GetRideIndex()) + if (CurrentRide != rideEntranceExitElement->AsEntrance()->GetRideIndex()) return; uint8_t exit_index = rideEntranceExitElement->AsEntrance()->GetStationIndex(); @@ -2065,7 +2065,7 @@ static constexpr const uint32_t FixingSubstatesForBreakdown[9] = { */ void Staff::UpdateFixing(int32_t steps) { - auto ride = get_ride(current_ride); + auto ride = get_ride(CurrentRide); if (ride == nullptr) { SetState(PEEP_STATE_FALLING); @@ -2433,7 +2433,7 @@ bool Staff::UpdateFixingMoveToStationStart(bool firstRun, Ride* ride) CoordsXYE input; input.x = stationPosition.x; input.y = stationPosition.y; - input.element = map_get_track_element_at_from_ride({ input.x, input.y, stationPosition.z }, current_ride); + input.element = map_get_track_element_at_from_ride({ input.x, input.y, stationPosition.z }, CurrentRide); if (input.element == nullptr) { return true; @@ -2618,7 +2618,7 @@ bool Staff::UpdateFixingFinishFixOrInspect(bool firstRun, int32_t steps, Ride* r if (state == PEEP_STATE_INSPECTING) { - UpdateRideInspected(current_ride); + UpdateRideInspected(CurrentRide); StaffRidesInspected++; window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME | RIDE_INVALIDATE_RIDE_LIST; diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 4334b463a0..373a14562a 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1466,7 +1466,7 @@ private: dst->nausea_tolerance = src->nausea_tolerance; dst->window_invalidate_flags = 0; - dst->current_ride = src->current_ride; + dst->CurrentRide = src->current_ride; dst->CurrentRideStation = src->current_ride_station; dst->CurrentTrain = src->current_train; dst->CurrentCar = src->current_car; @@ -3004,7 +3004,7 @@ private: Peep* peep; FOR_ALL_GUESTS (i, peep) { - if (peep->state == PEEP_STATE_QUEUING_FRONT && peep->current_ride == 0) + if (peep->state == PEEP_STATE_QUEUING_FRONT && peep->CurrentRide == 0) { peep->RemoveFromQueue(); peep->SetState(PEEP_STATE_FALLING); diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 5b04046bab..72d46f6498 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1172,7 +1172,7 @@ void S6Exporter::ExportSpritePeep(RCT2SpritePeep* dst, const Peep* src) dst->photo2_ride_ref = src->photo2_ride_ref; dst->photo3_ride_ref = src->photo3_ride_ref; dst->photo4_ride_ref = src->photo4_ride_ref; - dst->current_ride = src->current_ride; + dst->current_ride = src->CurrentRide; dst->current_ride_station = src->CurrentRideStation; dst->current_train = src->CurrentTrain; dst->time_to_sitdown = src->TimeToSitdown; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index b4670a10e7..fb9780245a 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1437,7 +1437,7 @@ public: dst->photo2_ride_ref = src->photo2_ride_ref; dst->photo3_ride_ref = src->photo3_ride_ref; dst->photo4_ride_ref = src->photo4_ride_ref; - dst->current_ride = src->current_ride; + dst->CurrentRide = src->current_ride; dst->CurrentRideStation = src->current_ride_station; dst->CurrentTrain = src->current_train; dst->TimeToSitdown = src->time_to_sitdown; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 82a0c5555a..6637e8a96f 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -1106,7 +1106,7 @@ void ride_remove_peeps(Ride* ride) if (peep->state == PEEP_STATE_QUEUING_FRONT || peep->state == PEEP_STATE_ENTERING_RIDE || peep->state == PEEP_STATE_LEAVING_RIDE || peep->state == PEEP_STATE_ON_RIDE) { - if (peep->current_ride != ride->id) + if (peep->CurrentRide != ride->id) continue; peep_decrement_num_riders(peep); @@ -2604,7 +2604,7 @@ static void ride_mechanic_status_update(Ride* ride, int32_t mechanicStatus) auto mechanic = ride_get_mechanic(ride); if (mechanic == nullptr || (mechanic->state != PEEP_STATE_HEADING_TO_INSPECTION && mechanic->state != PEEP_STATE_ANSWERING) - || mechanic->current_ride != ride->id) + || mechanic->CurrentRide != ride->id) { ride->mechanic_status = RIDE_MECHANIC_STATUS_CALLING; ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; @@ -2639,7 +2639,7 @@ static void ride_call_mechanic(Ride* ride, Peep* mechanic, int32_t forInspection ride->mechanic_status = RIDE_MECHANIC_STATUS_HEADING; ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; ride->mechanic = mechanic->sprite_index; - mechanic->current_ride = ride->id; + mechanic->CurrentRide = ride->id; mechanic->CurrentRideStation = ride->inspection_station; } @@ -5491,7 +5491,7 @@ void Ride::StopGuestsQueuing() { if (peep->state != PEEP_STATE_QUEUING) continue; - if (peep->current_ride != id) + if (peep->CurrentRide != id) continue; peep->RemoveFromQueue(); diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 901321168a..c490356093 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -3055,7 +3055,7 @@ void Vehicle::PeepEasterEggHereWeAre() const Peep* curPeep = GET_PEEP(vehicle->peep[i]); if (curPeep->PeepFlags & PEEP_FLAGS_HERE_WE_ARE) { - curPeep->InsertNewThought(PEEP_THOUGHT_TYPE_HERE_WE_ARE, curPeep->current_ride); + curPeep->InsertNewThought(PEEP_THOUGHT_TYPE_HERE_WE_ARE, curPeep->CurrentRide); } } } while ((spriteId = vehicle->next_vehicle_on_train) != SPRITE_INDEX_NULL); diff --git a/test/tests/S6ImportExportTests.cpp b/test/tests/S6ImportExportTests.cpp index fae032e6a4..729e2c9249 100644 --- a/test/tests/S6ImportExportTests.cpp +++ b/test/tests/S6ImportExportTests.cpp @@ -194,7 +194,7 @@ static void CompareSpriteDataPeep(const Peep& left, const Peep& right) COMPARE_FIELD(photo2_ride_ref); COMPARE_FIELD(photo3_ride_ref); COMPARE_FIELD(photo4_ride_ref); - COMPARE_FIELD(current_ride); + COMPARE_FIELD(CurrentRide); COMPARE_FIELD(CurrentRideStation); COMPARE_FIELD(CurrentTrain); COMPARE_FIELD(TimeToSitdown);