From 2147b6910493d8ee97d0664b4f65514bf66b8457 Mon Sep 17 00:00:00 2001 From: Matt <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 23 Dec 2023 16:04:25 +0200 Subject: [PATCH] Update the money effect even when the game is paused (#21102) * Update the money effect even when the game is paused * Update changelog.txt --- distribution/changelog.txt | 1 + src/openrct2/GameState.cpp | 3 +++ src/openrct2/entity/EntityRegistry.cpp | 5 +++++ src/openrct2/entity/EntityRegistry.h | 1 + 4 files changed, 10 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index d2c88b1144..ece0b0786b 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -10,6 +10,7 @@ - Feature: [OpenMusic#50] Added Rock style 4 ride music. - Change: [#20790] Default ride price set to free if park charges for entry. - Change: [#20880] Restore removed default coaster colours. +- Change: [#21102] The money effect will now update even when the game is paused. - Fix: [#12299] Placing ride entrances/exits ignores the Disable Clearance Checks cheat. - Fix: [#13473] Guests complain that the default Circus price is too high. - Fix: [#15293] TTF fonts don’t format correctly with OpenGL. diff --git a/src/openrct2/GameState.cpp b/src/openrct2/GameState.cpp index 9a96c5cca0..5dac4347c8 100644 --- a/src/openrct2/GameState.cpp +++ b/src/openrct2/GameState.cpp @@ -173,6 +173,9 @@ void GameState::Tick() NetworkSendTick(); } + // Keep updating the money effect even when paused. + UpdateMoneyEffect(); + // Update the animation list. Note this does not // increment the map animation. MapAnimationInvalidateAll(); diff --git a/src/openrct2/entity/EntityRegistry.cpp b/src/openrct2/entity/EntityRegistry.cpp index c8af092eb1..74d263b4dd 100644 --- a/src/openrct2/entity/EntityRegistry.cpp +++ b/src/openrct2/entity/EntityRegistry.cpp @@ -409,6 +409,11 @@ void UpdateAllMiscEntities() Balloon, Duck>(); } +void UpdateMoneyEffect() +{ + MiscUpdateAllTypes(); +} + // Performs a search to ensure that insert keeps next_in_quadrant in sprite_index order static void EntitySpatialInsert(EntityBase* entity, const CoordsXY& newLoc) { diff --git a/src/openrct2/entity/EntityRegistry.h b/src/openrct2/entity/EntityRegistry.h index a0f9531b13..640797bdc2 100644 --- a/src/openrct2/entity/EntityRegistry.h +++ b/src/openrct2/entity/EntityRegistry.h @@ -50,6 +50,7 @@ template T* CreateEntityAt(const EntityId index) void ResetAllEntities(); void ResetEntitySpatialIndices(); void UpdateAllMiscEntities(); +void UpdateMoneyEffect(); void EntitySetCoordinates(const CoordsXYZ& entityPos, EntityBase* entity); void EntityRemove(EntityBase* entity); uint16_t RemoveFloatingEntities();