MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / FindRCT2SteamPath

Function FindRCT2SteamPath

src/openrct2/config/Config.cpp:767–798  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

765 }
766
767 static u8string FindRCT2SteamPath()
768 {
769 auto steamPaths = Platform::GetSteamPaths();
770 if (steamPaths.isSteamPresent())
771 {
772 const std::array<Platform::SteamGameData, 2> gamesToCheck = {
773 Platform::kSteamRCT2Data,
774 Platform::kSteamRCTCData,
775 };
776 for (const auto& root : steamPaths.roots)
777 {
778 for (const auto& game : gamesToCheck)
779 {
780 auto nativePath = Path::Combine(root, steamPaths.nativeFolder, game.nativeFolder);
781 if (Platform::OriginalGameDataExists(nativePath))
782 {
783 return nativePath;
784 }
785 if (!steamPaths.downloadDepotFolder.empty())
786 {
787 auto downloadDepotPath = steamPaths.getDownloadDepotFolder(root, game);
788 if (Platform::OriginalGameDataExists(downloadDepotPath))
789 {
790 return downloadDepotPath;
791 }
792 }
793 }
794 }
795 }
796
797 return {};
798 }
799
800 /**
801 * Attempts to find the RCT2 installation directory.

Callers 2

FindRCT2PathFunction · 0.85

Calls 6

OriginalGameDataExistsFunction · 0.85
isSteamPresentMethod · 0.80
GetSteamPathsFunction · 0.50
CombineFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected