From a7dd47f48bc31b43b7eaf2a6d9a16822d025ff44 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek <1478678+Gymnasiast@users.noreply.github.com> Date: Wed, 26 Nov 2025 16:43:39 +0100 Subject: [PATCH] Fix #24952: Duplicate track designs when running via Steam without having RCT1 linked --- distribution/changelog.txt | 1 + src/openrct2/PlatformEnvironment.cpp | 3 +++ src/openrct2/core/FileIndex.hpp | 3 +++ 3 files changed, 7 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index f35eb05840..ad806be60f 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -3,6 +3,7 @@ - Improved: [#25529] The map selection grid no longer redraws every frame if it has not changed. - Improved: [#25530] Wall dragging can now be cancelled without closing the Scenery window. - Change: [#25485] Make the enlarged pressed swatch sprite more pronounced. +- Fix: [#24952] Duplicate track designs when running via Steam without having RCT1 linked. - Fix: [#25524] The track construction arrow does not immediately change position when deleting track pieces. - Fix: [#25565] Chairlift station ends are missing tunnels at certain rotations. diff --git a/src/openrct2/PlatformEnvironment.cpp b/src/openrct2/PlatformEnvironment.cpp index 8772048703..f656142adb 100644 --- a/src/openrct2/PlatformEnvironment.cpp +++ b/src/openrct2/PlatformEnvironment.cpp @@ -108,6 +108,9 @@ public: { default: case DirBase::rct1: + if (basePath.empty()) + return {}; + directoryName = kDirectoryNamesRCT2[EnumValue(did)]; break; case DirBase::rct2: diff --git a/src/openrct2/core/FileIndex.hpp b/src/openrct2/core/FileIndex.hpp index cd4af38ec3..10ebf93282 100644 --- a/src/openrct2/core/FileIndex.hpp +++ b/src/openrct2/core/FileIndex.hpp @@ -144,6 +144,9 @@ private: std::vector files; for (const auto& directory : SearchPaths) { + if (directory.empty()) + continue; + auto absoluteDirectory = OpenRCT2::Path::GetAbsolute(directory); LOG_VERBOSE("FileIndex:Scanning for %s in '%s'", _pattern.c_str(), absoluteDirectory.c_str());