Fix #23859: Wrong banner text displayed after loading different park

The scrolling text cache matches entries using memcmp on raw Formatter data which includes pointers to ride/banner names. When loading a new park, memory addresses can be reused, causing false cache matches that display text from the previous park. This adds invalidate() calls to both park loading paths to clear stale cache entries
This commit is contained in:
frozensnowy authored and Gymnasiast committed 2026-02-01 13:41:47 +01:00
1 parent ce0969884e
commit 10ea862bda
3 files changed
+10

No files matched your search

+1
View File
@@ -13,6 +13,7 @@
- Fix: [#18441] Replacing footpaths sometimes results in a spurious “Footpath in the way” error (original bug).
- Fix: [#20620] In-game console caret does not update when pasting.
- Fix: [#20652] Twister Roller Coaster design ‘u(0241)’ has no preview and cannot be built (bug in track design).
- Fix: [#23859] Wrong banner text displayed after loading a different park.
- Fix: [#25221] When trying to cancel game file discovery, the prompt reappears.
- Fix: [#25703, #25889] Crash when scanning scenarios with packed objects in parallel.
- Fix: [#25739] Game freezes when a tab in the New Ride window contains more than 384 items.
@@ -24,6 +24,7 @@
#include <openrct2/core/Path.hpp>
#include <openrct2/core/String.hpp>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/drawing/ScrollingText.h>
#include <openrct2/entity/EntityRegistry.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/localisation/StringIds.h>
@@ -439,6 +440,9 @@ namespace OpenRCT2::Title
gameState.entities.ResetEntitySpatialIndices();
ResetAllSpriteQuadrantPlacements();
// Invalidate scrolling text cache to prevent stale text from previous park
Drawing::ScrollingText::invalidate();
auto intent = Intent(INTENT_ACTION_REFRESH_NEW_RIDES);
ContextBroadcastIntent(&intent);
Ui::Windows::WindowScenerySetDefaultPlacementConfiguration();
+5
View File
@@ -32,6 +32,7 @@
#include "core/Path.hpp"
#include "core/String.hpp"
#include "drawing/Drawing.h"
#include "drawing/ScrollingText.h"
#include "entity/EntityList.h"
#include "entity/EntityRegistry.h"
#include "entity/PatrolArea.h"
@@ -362,6 +363,10 @@ void GameLoadInit()
context->SetActiveScene(context->GetGameScene());
// Invalidate scrolling text cache to prevent stale text from previous park
// being displayed due to pointer value reuse in the cache matching logic
Drawing::ScrollingText::invalidate();
if (!gLoadKeepWindowsOpen)
{
ContextResetSubsystems();