From 4da7daa2f989e3ba5532c41ee6673d2a25372268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20R=C3=B6dl?= Date: Thu, 25 Jun 2026 20:41:25 +0200 Subject: [PATCH] Fix OpenRCT2#7921: Search in user's wine path for RCT2 and RCT1 install files (#26292) --- contributors.md | 3 ++- distribution/changelog.txt | 3 ++- src/openrct2/config/Config.cpp | 8 ++++---- src/openrct2/platform/Platform.Android.cpp | 4 ++-- src/openrct2/platform/Platform.Emscripten.cpp | 4 ++-- src/openrct2/platform/Platform.Linux.cpp | 20 +++++++++++++++++-- src/openrct2/platform/Platform.Win32.cpp | 4 ++-- src/openrct2/platform/Platform.h | 4 ++-- src/openrct2/platform/Platform.macOS.mm | 4 ++-- 9 files changed, 36 insertions(+), 18 deletions(-) diff --git a/contributors.md b/contributors.md index 8420459c3c..dc2746b504 100644 --- a/contributors.md +++ b/contributors.md @@ -262,6 +262,7 @@ Appreciation for contributors who have provided substantial work, but are no lon * (pg805) * Sjoerd de Bruin (sjoerddebruin) * Alex Harvey (loonyduck1) +* Daniel Rödl (danielroedl) ## Toolchain * (Balletie) - macOS @@ -296,7 +297,7 @@ Appreciation for contributors who have provided substantial work, but are no lon * Catalan - Joan Josep (J0anJosep) * Chinese (Simplified) - Naiji Ma (naijim), (izhangfei), Eric Zhao (sczyh30), (Muhhan), Arnold Zhou (mrmagic2020) * Chinese (Traditional) - Harry Lam (daihakken) -* Czech - Martin Černáč (octaroot), (Clonewayx), Tomáš Pazdiora (Aroidzap), Ríša Szlachta (tygrysek90) +* Czech - Martin Černáč (octaroot), (Clonewayx), Tomáš Pazdiora (Aroidzap), Ríša Szlachta (tygrysek90) * Danish - Lars P. Sørensen (LPSGizmo) * Dutch - Michael Steenbeek (Gymnasiast), Yannic Geurts (xzbobzx), (mrtnptrs), Thomas den Hollander (ThomasdenH), (hostbrute), Marijn van der Werf (marijnvdwerf), Tom Kroes (ThePsionic), Karst van Galen Last (AuraSpecs); reviewing and discussion: Aaron van Geffen (AaronVanGeffen), (Balletie) and Sijmen Schoon (SijmenSchoon) * Esperanto - (tellovishous), Raymond Zhao (rzhao271) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 4a186ce09d..9e10db3f01 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -2,6 +2,7 @@ ------------------------------------------------------------------------ - Feature: [#26308] Add all new track pieces to the inverted roller coaster. - Feature: [#26442] Add cheat to disable grass growing. +- Improved: [#7921] On Linux, RCT2 and RCT1 installs in Wine are now automatically detected. - Improved: [#26325] Changing the train type, length, or direction no longer resets the number of laps if there is just one train. - Improved: [objects#437] Re-order St. Basil’s Cathedral pieces to be more consistent. - Change: [#26689] A clear scenario editor can now be opened directly from the command line. @@ -581,7 +582,7 @@ - Change: [#23328] All RCT2 entertainer costumes are now available in legacy parks. - Fix: [#1479] Incorrect values provided by the in game console “get location” command. - Fix: [#21794] Lay-down coaster cars reverse on first frames of downwards corkscrew. -- Fix: [#23221] Track designs are saved with an incorrect ‘air’ time statistic. +- Fix: [#23221] Track designs are saved with an incorrect ‘air’ time statistic. - Fix: [#23368] Incorrect refund amount when deleting track pieces at or above 96m. - Fix: [#23508] Simultaneous virtual floors shown for ride and footpath. - Fix: [#23512] Holding brakes are skipped if they’re too close together. diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index b6ddcc9af9..14fd45c346 100644 --- a/src/openrct2/config/Config.cpp +++ b/src/openrct2/config/Config.cpp @@ -725,13 +725,13 @@ namespace OpenRCT2::Config { LOG_VERBOSE("config_find_rct1_path(...)"); - static std::vector searchLocations = Platform::GetSearchablePathsRCT1(); + static std::vector searchLocations = Platform::GetSearchablePathsRCT1(); for (const auto& location : searchLocations) { if (RCT1DataPresentAtLocation(location)) { - return u8string(location); + return location; } } @@ -806,13 +806,13 @@ namespace OpenRCT2::Config { LOG_VERBOSE("config_find_rct2_path(...)"); - static std::vector searchLocations = Platform::GetSearchablePathsRCT2(); + static std::vector searchLocations = Platform::GetSearchablePathsRCT2(); for (const auto& location : searchLocations) { if (Platform::OriginalGameDataExists(location)) { - return u8string(location); + return location; } } diff --git a/src/openrct2/platform/Platform.Android.cpp b/src/openrct2/platform/Platform.Android.cpp index f0fe6e12ac..c244e79751 100644 --- a/src/openrct2/platform/Platform.Android.cpp +++ b/src/openrct2/platform/Platform.Android.cpp @@ -471,12 +471,12 @@ namespace OpenRCT2::Platform return _assetList; } - std::vector GetSearchablePathsRCT1() + std::vector GetSearchablePathsRCT1() { return { "/sdcard/rct1" }; } - std::vector GetSearchablePathsRCT2() + std::vector GetSearchablePathsRCT2() { return { "/sdcard/rct2" }; } diff --git a/src/openrct2/platform/Platform.Emscripten.cpp b/src/openrct2/platform/Platform.Emscripten.cpp index 1e391dd69c..22095995bc 100644 --- a/src/openrct2/platform/Platform.Emscripten.cpp +++ b/src/openrct2/platform/Platform.Emscripten.cpp @@ -109,12 +109,12 @@ namespace OpenRCT2::Platform } #endif - std::vector GetSearchablePathsRCT1() + std::vector GetSearchablePathsRCT1() { return { "/RCT" }; } - std::vector GetSearchablePathsRCT2() + std::vector GetSearchablePathsRCT2() { return { "/RCT" }; } diff --git a/src/openrct2/platform/Platform.Linux.cpp b/src/openrct2/platform/Platform.Linux.cpp index 126ac8b420..250bb91951 100644 --- a/src/openrct2/platform/Platform.Linux.cpp +++ b/src/openrct2/platform/Platform.Linux.cpp @@ -390,17 +390,33 @@ namespace OpenRCT2::Platform return ret; } - std::vector GetSearchablePathsRCT1() + std::vector GetSearchablePathsRCT1() { + auto userHome = GetFolderPath(SpecialFolder::userHome); return { + userHome + "/.wine/drive_c/GOG Games/RollerCoaster Tycoon Deluxe", + userHome + "/.wine/drive_c/Program Files/GalaxyClient/Games/RollerCoaster Tycoon Deluxe", + userHome + "/.wine/drive_c/Program Files (x86)/GalaxyClient/Games/RollerCoaster Tycoon Deluxe", + userHome + "/.wine/drive_c/Program Files/Hasbro Interactive/RollerCoaster Tycoon", + userHome + "/.wine/drive_c/Program Files (x86)/Hasbro Interactive/RollerCoaster Tycoon", // game-data-packager uses this path when installing game files "/usr/share/games/roller-coaster-tycoon", }; } - std::vector GetSearchablePathsRCT2() + std::vector GetSearchablePathsRCT2() { + auto userHome = GetFolderPath(SpecialFolder::userHome); return { + userHome + "/.wine/drive_c/GOG Games/RollerCoaster Tycoon 2 Triple Thrill Pack", + userHome + "/.wine/drive_c/Program Files/GalaxyClient/Games/RollerCoaster Tycoon 2 Triple Thrill Pack", + userHome + "/.wine/drive_c/Program Files (x86)/GalaxyClient/Games/RollerCoaster Tycoon 2 Triple Thrill Pack", + userHome + "/.wine/drive_c/Program Files/Atari/RollerCoaster Tycoon 2", + userHome + "/.wine/drive_c/Program Files (x86)/Atari/RollerCoaster Tycoon 2", + userHome + "/.wine/drive_c/Program Files/Infogrames/RollerCoaster Tycoon 2", + userHome + "/.wine/drive_c/Program Files (x86)/Infogrames/RollerCoaster Tycoon 2", + userHome + "/.wine/drive_c/Program Files/Infogrames Interactive/RollerCoaster Tycoon 2", + userHome + "/.wine/drive_c/Program Files (x86)/Infogrames Interactive/RollerCoaster Tycoon 2", // game-data-packager uses this path when installing game files "/usr/share/games/roller-coaster-tycoon2", }; diff --git a/src/openrct2/platform/Platform.Win32.cpp b/src/openrct2/platform/Platform.Win32.cpp index 9787115e72..e9eb39cd1a 100644 --- a/src/openrct2/platform/Platform.Win32.cpp +++ b/src/openrct2/platform/Platform.Win32.cpp @@ -882,7 +882,7 @@ namespace OpenRCT2::Platform return false; } - std::vector GetSearchablePathsRCT1() + std::vector GetSearchablePathsRCT1() { return { R"(C:\Program Files\Steam\steamapps\common\Rollercoaster Tycoon Deluxe)", @@ -895,7 +895,7 @@ namespace OpenRCT2::Platform }; } - std::vector GetSearchablePathsRCT2() + std::vector GetSearchablePathsRCT2() { return { R"(C:\Program Files\Steam\steamapps\common\Rollercoaster Tycoon 2)", diff --git a/src/openrct2/platform/Platform.h b/src/openrct2/platform/Platform.h index ed47478c7d..e1819f4aa5 100644 --- a/src/openrct2/platform/Platform.h +++ b/src/openrct2/platform/Platform.h @@ -231,8 +231,8 @@ namespace OpenRCT2::Platform bool SSE41Available(); bool AVX2Available(); - std::vector GetSearchablePathsRCT1(); - std::vector GetSearchablePathsRCT2(); + std::vector GetSearchablePathsRCT1(); + std::vector GetSearchablePathsRCT2(); } // namespace OpenRCT2::Platform #ifdef __ANDROID__ diff --git a/src/openrct2/platform/Platform.macOS.mm b/src/openrct2/platform/Platform.macOS.mm index 617af45e6a..4e08403ad4 100644 --- a/src/openrct2/platform/Platform.macOS.mm +++ b/src/openrct2/platform/Platform.macOS.mm @@ -270,12 +270,12 @@ namespace OpenRCT2::Platform } } - std::vector GetSearchablePathsRCT1() + std::vector GetSearchablePathsRCT1() { return {}; } - std::vector GetSearchablePathsRCT2() + std::vector GetSearchablePathsRCT2() { return { "/Applications" }; }