diff --git a/CMakeLists.txt b/CMakeLists.txt index a1f5baa2ec..a83d4b4f9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,9 +65,9 @@ set(OBJECTS_VERSION "1.2.1") set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip") set(OBJECTS_SHA1 "540e004abc683b3fe22211f5234e3d78ab023c5f") -set(REPLAYS_VERSION "0.0.55") +set(REPLAYS_VERSION "0.0.56") set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v${REPLAYS_VERSION}/replays.zip") -set(REPLAYS_SHA1 "70B4B7CB26A428801676BCC615F3881E72A45406") +set(REPLAYS_SHA1 "C47048B71A95A95428A08035C94AD10E7A020D4D") option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags.") option(WITH_TESTS "Build tests") diff --git a/distribution/changelog.txt b/distribution/changelog.txt index c921a159a9..32a5429977 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -38,6 +38,7 @@ - Fix: [#15503] Freeze when doing specific coaster merges with block brakes. - Fix: [#15514] Two different “quit to menu” menu items are available in track designer and track design manager. - Fix: [#15560] Memory leak due to OpenGL Renderer not releasing a texture. +- Fix: [#15567] Litter not being counted correctly during Park rating calculation (original bug). - Improved: [#3417] Crash dumps are now placed in their own folder. - Improved: [#13524] macOS arm64 native (universal) app - Improved: [#15538] Software rendering can now draw in parallel when Multithreading is enabled. diff --git a/openrct2.proj b/openrct2.proj index 0613112165..12aed214aa 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -48,8 +48,8 @@ 304d13a126c15bf2c86ff13b81a2f2cc1856ac8d https://github.com/OpenRCT2/objects/releases/download/v1.2.1/objects.zip 540e004abc683b3fe22211f5234e3d78ab023c5f - https://github.com/OpenRCT2/replays/releases/download/v0.0.55/replays.zip - 70B4B7CB26A428801676BCC615F3881E72A45406 + https://github.com/OpenRCT2/replays/releases/download/v0.0.56/replays.zip + C47048B71A95A95428A08035C94AD10E7A020D4D diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 3b68f82cfc..6c79985b3f 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -40,7 +40,7 @@ // This string specifies which version of network stream current build uses. // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "13" +#define NETWORK_STREAM_VERSION "14" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr; diff --git a/src/openrct2/world/EntityList.h b/src/openrct2/world/EntityList.h index 19489ae49b..60d967aac5 100644 --- a/src/openrct2/world/EntityList.h +++ b/src/openrct2/world/EntityList.h @@ -165,11 +165,11 @@ public: { } - EntityListIterator_t begin() + EntityListIterator_t begin() const { return EntityListIterator_t(std::cbegin(vec), std::cend(vec)); } - EntityListIterator_t end() + EntityListIterator_t end() const { return EntityListIterator_t(std::cend(vec), std::cend(vec)); } diff --git a/src/openrct2/world/Litter.cpp b/src/openrct2/world/Litter.cpp index 5f8ccba8d3..236f0150af 100644 --- a/src/openrct2/world/Litter.cpp +++ b/src/openrct2/world/Litter.cpp @@ -125,3 +125,8 @@ rct_string_id Litter::GetName() const return STR_NONE; return litterNames[EnumValue(SubType)]; } + +uint32_t Litter::GetAge() const +{ + return gCurrentTicks - creationTick; +} diff --git a/src/openrct2/world/Litter.h b/src/openrct2/world/Litter.h index 2aafcfeecf..52c8381f60 100644 --- a/src/openrct2/world/Litter.h +++ b/src/openrct2/world/Litter.h @@ -40,4 +40,5 @@ struct Litter : EntityBase static void RemoveAt(const CoordsXYZ& litterPos); void Serialise(DataSerialiser& stream); rct_string_id GetName() const; + uint32_t GetAge() const; }; diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index c8ff39b4bd..ddcec0d235 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -463,15 +463,11 @@ int32_t Park::CalculateParkRating() const // Litter { - int32_t litterCount = 0; - for (auto litter : EntityList()) - { - // Ignore recently dropped litter - if (litter->creationTick - gCurrentTicks >= 7680) - { - litterCount++; - } - } + // Counts the amount of litter whose age is min. 7680 ticks (5~ min) old. + const auto litterList = EntityList(); + const auto litterCount = std::count_if( + litterList.begin(), litterList.end(), [](auto* litter) { return litter->GetAge() >= 7680; }); + result -= 600 - (4 * (150 - std::min(150, litterCount))); }