diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 8d62b0fdcd..397427bc9b 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -261,7 +261,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(Peep, action); COMPARE_FIELD(Peep, action_frame); COMPARE_FIELD(Peep, step_progress); - COMPARE_FIELD(Peep, next_in_queue); + COMPARE_FIELD(Peep, NextInQueue); COMPARE_FIELD(Peep, MazeLastEdge); COMPARE_FIELD(Peep, InteractionRideIndex); COMPARE_FIELD(Peep, TimeInQueue); diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 506f093f50..d07d620948 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -5551,14 +5551,14 @@ void Guest::UpdateQueuing() if (sub_state != 10) { bool is_front = true; - if (next_in_queue != SPRITE_INDEX_NULL) + if (NextInQueue != SPRITE_INDEX_NULL) { - // Fix #4819: Occasionally the peep->next_in_queue is incorrectly set + // Fix #4819: Occasionally the peep->NextInQueue is incorrectly set // to prevent this from causing the peeps to enter a loop // first check if the next in queue is actually nearby // if they are not then it's safe to assume that this is // the front of the queue. - Peep* next_peep = GET_PEEP(next_in_queue); + Peep* next_peep = GET_PEEP(NextInQueue); if (abs(next_peep->x - x) < 32 && abs(next_peep->y - y) < 32) { is_front = false; diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index a05f4c0784..ad5c069af2 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -2266,10 +2266,10 @@ void Peep::SwitchNextActionSpriteType() static bool peep_update_queue_position(Peep* peep, uint8_t previous_action) { peep->TimeInQueue++; - if (peep->next_in_queue == SPRITE_INDEX_NULL) + if (peep->NextInQueue == SPRITE_INDEX_NULL) return false; - Peep* peep_next = GET_PEEP(peep->next_in_queue); + Peep* peep_next = GET_PEEP(peep->NextInQueue); int16_t x_diff = abs(peep_next->x - peep->x); int16_t y_diff = abs(peep_next->y - peep->y); @@ -2430,7 +2430,7 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl uint16_t previous_last = ride->stations[stationNum].LastPeepInQueue; ride->stations[stationNum].LastPeepInQueue = peep->sprite_index; - peep->next_in_queue = previous_last; + peep->NextInQueue = previous_last; ride->stations[stationNum].QueueLength++; peep->current_ride = rideIndex; @@ -2858,7 +2858,7 @@ static void peep_interact_with_path(Peep* peep, int16_t x, int16_t y, TileElemen // Add the peep to the ride queue. uint16_t old_last_peep = ride->stations[stationNum].LastPeepInQueue; ride->stations[stationNum].LastPeepInQueue = peep->sprite_index; - peep->next_in_queue = old_last_peep; + peep->NextInQueue = old_last_peep; ride->stations[stationNum].QueueLength++; peep_decrement_num_riders(peep); @@ -3425,7 +3425,7 @@ void Peep::RemoveFromQueue() if (sprite_index == station.LastPeepInQueue) { - station.LastPeepInQueue = next_in_queue; + station.LastPeepInQueue = NextInQueue; return; } @@ -3433,12 +3433,12 @@ void Peep::RemoveFromQueue() while (spriteId != SPRITE_INDEX_NULL) { Peep* other_peep = GET_PEEP(spriteId); - if (sprite_index == other_peep->next_in_queue) + if (sprite_index == other_peep->NextInQueue) { - other_peep->next_in_queue = next_in_queue; + other_peep->NextInQueue = NextInQueue; return; } - spriteId = other_peep->next_in_queue; + spriteId = other_peep->NextInQueue; } } diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index aefecb7d1c..38d456fc3d 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -665,7 +665,7 @@ struct Peep : SpriteBase union { uint16_t mechanic_time_since_call; // time getting to ride to fix - uint16_t next_in_queue; + uint16_t NextInQueue; }; union { diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 7ddd94a8e4..f50300f40f 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1530,7 +1530,7 @@ private: // Doubles as staff orders dst->GuestIsLostCountdown = src->peep_is_lost_countdown; // The ID is fixed later - dst->next_in_queue = src->next_in_queue; + dst->NextInQueue = src->next_in_queue; dst->PeepFlags = 0; dst->PathfindGoal.x = 0xFF; @@ -1581,7 +1581,7 @@ private: void FixPeepNextInQueue(Peep* peep, const uint16_t* spriteIndexMap) { - peep->next_in_queue = MapSpriteIndex(peep->next_in_queue, spriteIndexMap); + peep->NextInQueue = MapSpriteIndex(peep->NextInQueue, spriteIndexMap); } void ImportStaffPatrolArea(Peep* staffmember) diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index d30b9909b0..5c691c2d40 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1183,7 +1183,7 @@ void S6Exporter::ExportSpritePeep(RCT2SpritePeep* dst, const Peep* src) dst->action = static_cast(src->action); dst->action_frame = src->action_frame; dst->step_progress = src->step_progress; - dst->next_in_queue = src->next_in_queue; + dst->next_in_queue = src->NextInQueue; dst->direction = src->PeepDirection; dst->interaction_ride_index = src->InteractionRideIndex; dst->time_in_queue = src->TimeInQueue; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 5ae184cc3c..76fd427c1e 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1448,7 +1448,7 @@ public: dst->action = static_cast(src->action); dst->action_frame = src->action_frame; dst->step_progress = src->step_progress; - dst->next_in_queue = src->next_in_queue; + dst->NextInQueue = src->next_in_queue; dst->PeepDirection = src->direction; dst->InteractionRideIndex = src->interaction_ride_index; dst->TimeInQueue = src->time_in_queue; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 39f9615d81..2fd381ad16 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -309,7 +309,7 @@ Peep* Ride::GetQueueHeadGuest(StationIndex stationIndex) const uint16_t spriteIndex = stations[stationIndex].LastPeepInQueue; while ((peep = try_get_guest(spriteIndex)) != nullptr) { - spriteIndex = peep->next_in_queue; + spriteIndex = peep->NextInQueue; result = peep; } return result; @@ -322,7 +322,7 @@ void Ride::UpdateQueueLength(StationIndex stationIndex) uint16_t spriteIndex = stations[stationIndex].LastPeepInQueue; while ((peep = try_get_guest(spriteIndex)) != nullptr) { - spriteIndex = peep->next_in_queue; + spriteIndex = peep->NextInQueue; count++; } stations[stationIndex].QueueLength = count; @@ -333,7 +333,7 @@ void Ride::QueueInsertGuestAtFront(StationIndex stationIndex, Peep* peep) assert(stationIndex < MAX_STATIONS); assert(peep != nullptr); - peep->next_in_queue = SPRITE_INDEX_NULL; + peep->NextInQueue = SPRITE_INDEX_NULL; Peep* queueHeadGuest = GetQueueHeadGuest(peep->current_ride_station); if (queueHeadGuest == nullptr) { @@ -341,7 +341,7 @@ void Ride::QueueInsertGuestAtFront(StationIndex stationIndex, Peep* peep) } else { - queueHeadGuest->next_in_queue = peep->sprite_index; + queueHeadGuest->NextInQueue = peep->sprite_index; } UpdateQueueLength(peep->current_ride_station); } diff --git a/test/tests/S6ImportExportTests.cpp b/test/tests/S6ImportExportTests.cpp index 74e9bdf91f..bc1b9204d2 100644 --- a/test/tests/S6ImportExportTests.cpp +++ b/test/tests/S6ImportExportTests.cpp @@ -205,7 +205,7 @@ static void CompareSpriteDataPeep(const Peep& left, const Peep& right) COMPARE_FIELD(action); COMPARE_FIELD(action_frame); COMPARE_FIELD(step_progress); - COMPARE_FIELD(next_in_queue); + COMPARE_FIELD(NextInQueue); COMPARE_FIELD(MazeLastEdge); COMPARE_FIELD(InteractionRideIndex); COMPARE_FIELD(TimeInQueue);