From 0933cd4e5701f1c739b183f62efbd4eb90d65c9c Mon Sep 17 00:00:00 2001 From: Tulio Leao Date: Sun, 31 May 2020 17:29:44 -0300 Subject: [PATCH] Rename Peep::litter_count to LitterCount --- src/openrct2/GameStateSnapshots.cpp | 2 +- src/openrct2/peep/Guest.cpp | 2 +- src/openrct2/peep/Peep.cpp | 12 ++++++------ 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 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 970bd1e6f9..ce5e9bcfdf 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -291,7 +291,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(Peep, pathfind_history[i]); } COMPARE_FIELD(Peep, no_action_frame_num); - COMPARE_FIELD(Peep, litter_count); + COMPARE_FIELD(Peep, LitterCount); COMPARE_FIELD(Peep, TimeOnRide); COMPARE_FIELD(Peep, DisgustingCount); COMPARE_FIELD(Peep, PaidToEnter); diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index befe288de4..e81267205e 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -6212,7 +6212,7 @@ static void peep_update_walking_break_scenery(Peep* peep) if (peep->state != PEEP_STATE_WALKING) return; - if ((peep->litter_count & 0xC0) != 0xC0 && (peep->DisgustingCount & 0xC0) != 0xC0) + if ((peep->LitterCount & 0xC0) != 0xC0 && (peep->DisgustingCount & 0xC0) != 0xC0) return; if ((scenario_rand() & 0xFFFF) > 3276) diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index aaa05dd10a..fc52954cb2 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -1761,7 +1761,7 @@ Peep* Peep::Generate(const CoordsXYZ& coords) peep->ItemStandardFlags = 0; peep->item_extra_flags = 0; peep->guest_heading_to_ride_id = RIDE_ID_NULL; - peep->litter_count = 0; + peep->LitterCount = 0; peep->DisgustingCount = 0; peep->VandalismSeen = 0; peep->PaidToEnter = 0; @@ -2753,14 +2753,14 @@ static void peep_footpath_move_forward(Peep* peep, int16_t x, int16_t y, TileEle } } - uint8_t litter_time = peep->litter_count & 0xC0; - litter_count = ((peep->litter_count & 0xF) << 2) | litter_count; - peep->litter_count = litter_count | litter_time; + uint8_t litter_time = peep->LitterCount & 0xC0; + litter_count = ((peep->LitterCount & 0xF) << 2) | litter_count; + peep->LitterCount = litter_count | litter_time; if (litter_time & 0xC0 && (scenario_rand() & 0xFFFF) <= 4369) { // Reduce the litter time - peep->litter_count -= 0x40; + peep->LitterCount -= 0x40; } else { @@ -2775,7 +2775,7 @@ static void peep_footpath_move_forward(Peep* peep, int16_t x, int16_t y, TileEle peep->InsertNewThought(PEEP_THOUGHT_TYPE_BAD_LITTER, PEEP_THOUGHT_ITEM_NONE); peep->happiness_target = std::max(0, peep->happiness_target - 17); // Reset litter time - peep->litter_count |= 0xC0; + peep->LitterCount |= 0xC0; } } diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index 3fef87181a..a58ae9aec0 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -702,7 +702,7 @@ struct Peep : SpriteBase rct12_xyzd8 pathfind_history[4]; uint8_t no_action_frame_num; // 0x3F Litter Count split into lots of 3 with time, 0xC0 Time since last recalc - uint8_t litter_count; + uint8_t LitterCount; union { uint8_t TimeOnRide; diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index ff7fea37b1..a08ebc2989 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1459,7 +1459,7 @@ private: dst->toilet = src->toilet; dst->mass = src->mass; - dst->litter_count = src->litter_count; + dst->LitterCount = src->litter_count; dst->DisgustingCount = src->disgusting_count; dst->intensity = static_cast(src->intensity); diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 4bf3048b0c..d67f45e482 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1218,7 +1218,7 @@ void S6Exporter::ExportSpritePeep(RCT2SpritePeep* dst, const Peep* src) dst->pathfind_history[i] = src->pathfind_history[i]; } dst->no_action_frame_num = src->no_action_frame_num; - dst->litter_count = src->litter_count; + dst->litter_count = src->LitterCount; dst->time_on_ride = src->TimeOnRide; dst->disgusting_count = src->DisgustingCount; dst->paid_to_enter = src->PaidToEnter; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 480885794e..cc18fa0553 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1483,7 +1483,7 @@ public: dst->pathfind_history[i] = src->pathfind_history[i]; } dst->no_action_frame_num = src->no_action_frame_num; - dst->litter_count = src->litter_count; + dst->LitterCount = src->litter_count; dst->TimeOnRide = src->time_on_ride; dst->DisgustingCount = src->disgusting_count; dst->PaidToEnter = src->paid_to_enter; diff --git a/test/tests/S6ImportExportTests.cpp b/test/tests/S6ImportExportTests.cpp index a99c2419c4..391edd0260 100644 --- a/test/tests/S6ImportExportTests.cpp +++ b/test/tests/S6ImportExportTests.cpp @@ -244,7 +244,7 @@ static void CompareSpriteDataPeep(const Peep& left, const Peep& right) COMPARE_FIELD(pathfind_history[i].direction); } COMPARE_FIELD(no_action_frame_num); - COMPARE_FIELD(litter_count); + COMPARE_FIELD(LitterCount); COMPARE_FIELD(TimeOnRide); COMPARE_FIELD(DisgustingCount); COMPARE_FIELD(PaidToEnter);