From 1ac3b3d2dcbd45dbef31da7440f74f1fce772278 Mon Sep 17 00:00:00 2001 From: Tulio Leao Date: Sun, 7 Jun 2020 22:10:09 -0300 Subject: [PATCH] Rename Peep::current_train to use TitleCase --- src/openrct2/GameStateSnapshots.cpp | 2 +- src/openrct2/interface/Viewport.cpp | 2 +- src/openrct2/management/NewsItem.cpp | 2 +- src/openrct2/peep/Guest.cpp | 22 +++++++++++----------- src/openrct2/peep/Peep.h | 2 +- src/openrct2/rct1/S4Importer.cpp | 2 +- src/openrct2/rct2/S6Exporter.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 2 +- test/tests/S6ImportExportTests.cpp | 2 +- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 38d662c948..f9a621ff9c 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -252,7 +252,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(Peep, photo4_ride_ref); COMPARE_FIELD(Peep, current_ride); COMPARE_FIELD(Peep, current_ride_station); - COMPARE_FIELD(Peep, current_train); + COMPARE_FIELD(Peep, CurrentTrain); COMPARE_FIELD(Peep, TimeToSitdown); COMPARE_FIELD(Peep, SpecialSprite); COMPARE_FIELD(Peep, ActionSpriteType); diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 972e2e9d95..e40a0c48dc 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -692,7 +692,7 @@ viewport_focus viewport_update_smart_guest_follow(rct_window* window, Peep* peep auto ride = get_ride(peep->current_ride); if (ride != nullptr && (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) { - auto train = GET_VEHICLE(ride->vehicles[peep->current_train]); + auto train = GET_VEHICLE(ride->vehicles[peep->CurrentTrain]); if (train != nullptr) { auto car = train->GetCar(peep->CurrentCar); diff --git a/src/openrct2/management/NewsItem.cpp b/src/openrct2/management/NewsItem.cpp index 3657d69327..1e545f3b52 100644 --- a/src/openrct2/management/NewsItem.cpp +++ b/src/openrct2/management/NewsItem.cpp @@ -257,7 +257,7 @@ std::optional news_item_get_subject_location(int32_t type, int32_t su } // Find the first car of the train peep is on - sprite = try_get_sprite(ride->vehicles[peep->current_train]); + sprite = try_get_sprite(ride->vehicles[peep->CurrentTrain]); // Find the actual car peep is on for (int32_t i = 0; i < peep->CurrentCar && sprite != nullptr; i++) { diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 05e2370b68..08e7b55c93 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -2471,7 +2471,7 @@ static Vehicle* peep_choose_car_from_ride(Peep* peep, Ride* ride, std::vectorCurrentCar = car_array[chosen_car]; - Vehicle* vehicle = GET_VEHICLE(ride->vehicles[peep->current_train]); + Vehicle* vehicle = GET_VEHICLE(ride->vehicles[peep->CurrentTrain]); for (int32_t i = peep->CurrentCar; i > 0; --i) { @@ -2583,7 +2583,7 @@ bool Guest::FindVehicleToEnter(Ride* ride, std::vector& car_array) return false; } - current_train = chosen_train; + CurrentTrain = chosen_train; int32_t i = 0; @@ -3625,7 +3625,7 @@ static void peep_update_ride_leave_entrance_waypoints(Peep* peep, Ride* ride) uint8_t direction_track = (tile_element == nullptr ? 0 : tile_element->GetDirection()); - auto vehicle = GET_VEHICLE(ride->vehicles[peep->current_train]); + auto vehicle = GET_VEHICLE(ride->vehicles[peep->CurrentTrain]); auto ride_entry = get_ride_entry(vehicle->ride_subtype); auto vehicle_type = &ride_entry->vehicles[vehicle->vehicle_type]; @@ -3727,7 +3727,7 @@ void Guest::UpdateRideAdvanceThroughEntrance() } } - Vehicle* vehicle = GET_VEHICLE(ride->vehicles[current_train]); + Vehicle* vehicle = GET_VEHICLE(ride->vehicles[CurrentTrain]); if (vehicle == nullptr) { return; @@ -3957,7 +3957,7 @@ void Guest::UpdateRideFreeVehicleCheck() return; } - Vehicle* vehicle = GET_VEHICLE(ride->vehicles[current_train]); + Vehicle* vehicle = GET_VEHICLE(ride->vehicles[CurrentTrain]); for (int32_t i = CurrentCar; i != 0; --i) { vehicle = GET_VEHICLE(vehicle->next_vehicle_on_train); @@ -4015,7 +4015,7 @@ void Guest::UpdateRideFreeVehicleCheck() } } - Vehicle* currentTrain = GET_VEHICLE(ride->vehicles[current_train]); + Vehicle* currentTrain = GET_VEHICLE(ride->vehicles[CurrentTrain]); if (ride->status == RIDE_STATUS_OPEN && ++RejoinQueueTimeout != 0 && !currentTrain->UpdateFlag(VEHICLE_UPDATE_FLAG_TRAIN_READY_DEPART)) { @@ -4049,7 +4049,7 @@ void Guest::UpdateRideEnterVehicle() auto* ride = get_ride(current_ride); if (ride != nullptr) { - auto* vehicle = GET_VEHICLE(ride->vehicles[current_train]); + auto* vehicle = GET_VEHICLE(ride->vehicles[CurrentTrain]); if (vehicle != nullptr) { for (int32_t i = CurrentCar; i != 0; --i) @@ -4111,7 +4111,7 @@ void Guest::UpdateRideLeaveVehicle() if (ride == nullptr) return; - Vehicle* vehicle = GET_VEHICLE(ride->vehicles[current_train]); + Vehicle* vehicle = GET_VEHICLE(ride->vehicles[CurrentTrain]); uint8_t ride_station = vehicle->current_station; for (int32_t i = CurrentCar; i != 0; --i) @@ -4271,7 +4271,7 @@ void Guest::UpdateRideLeaveVehicle() Direction station_direction = (trackElement == nullptr ? 0 : trackElement->GetDirection()); - vehicle = GET_VEHICLE(ride->vehicles[current_train]); + vehicle = GET_VEHICLE(ride->vehicles[CurrentTrain]); rideEntry = get_ride_entry(vehicle->ride_subtype); rct_ride_entry_vehicle* vehicleEntry = &rideEntry->vehicles[vehicle->vehicle_type]; @@ -4456,7 +4456,7 @@ void Guest::UpdateRideApproachVehicleWaypoints() // This is incrementing the actual peep waypoint var_37++; - Vehicle* vehicle = GET_VEHICLE(ride->vehicles[current_train]); + Vehicle* vehicle = GET_VEHICLE(ride->vehicles[CurrentTrain]); CoordsXY targetLoc = ride->stations[current_ride_station].Start.ToTileCentre(); @@ -4525,7 +4525,7 @@ void Guest::UpdateRideApproachExitWaypoints() } var_37--; - Vehicle* vehicle = GET_VEHICLE(ride->vehicles[current_train]); + Vehicle* vehicle = GET_VEHICLE(ride->vehicles[CurrentTrain]); CoordsXY targetLoc = ride->stations[current_ride_station].Start.ToTileCentre(); if (ride->type == RIDE_TYPE_ENTERPRISE) diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index 91e09728d5..5c1e554023 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -637,7 +637,7 @@ struct Peep : SpriteBase uint8_t photo4_ride_ref; uint8_t current_ride; StationIndex current_ride_station; - uint8_t current_train; + uint8_t CurrentTrain; union { struct diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 3b46c2f3cd..69b31f09c4 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1468,7 +1468,7 @@ private: dst->current_ride = src->current_ride; dst->current_ride_station = src->current_ride_station; - dst->current_train = src->current_train; + dst->CurrentTrain = src->current_train; dst->CurrentCar = src->current_car; dst->CurrentSeat = src->current_seat; dst->GuestTimeOnRide = src->time_on_ride; diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index eea7cbed78..f3982eef7b 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1174,7 +1174,7 @@ void S6Exporter::ExportSpritePeep(RCT2SpritePeep* dst, const Peep* src) dst->photo4_ride_ref = src->photo4_ride_ref; dst->current_ride = src->current_ride; dst->current_ride_station = src->current_ride_station; - dst->current_train = src->current_train; + dst->current_train = src->CurrentTrain; dst->time_to_sitdown = src->TimeToSitdown; dst->special_sprite = src->SpecialSprite; dst->action_sprite_type = static_cast(src->ActionSpriteType); diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 4c6ff6417d..66247e0491 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1439,7 +1439,7 @@ public: dst->photo4_ride_ref = src->photo4_ride_ref; dst->current_ride = src->current_ride; dst->current_ride_station = src->current_ride_station; - dst->current_train = src->current_train; + dst->CurrentTrain = src->current_train; dst->TimeToSitdown = src->time_to_sitdown; dst->SpecialSprite = src->special_sprite; dst->ActionSpriteType = static_cast(src->action_sprite_type); diff --git a/test/tests/S6ImportExportTests.cpp b/test/tests/S6ImportExportTests.cpp index fbd3f099eb..f1dd1c87c8 100644 --- a/test/tests/S6ImportExportTests.cpp +++ b/test/tests/S6ImportExportTests.cpp @@ -196,7 +196,7 @@ static void CompareSpriteDataPeep(const Peep& left, const Peep& right) COMPARE_FIELD(photo4_ride_ref); COMPARE_FIELD(current_ride); COMPARE_FIELD(current_ride_station); - COMPARE_FIELD(current_train); + COMPARE_FIELD(CurrentTrain); COMPARE_FIELD(TimeToSitdown); COMPARE_FIELD(SpecialSprite); COMPARE_FIELD(ActionSpriteType);