Skip to content

Commit

Permalink
Hot Fix for FamilyShare for #4018
Browse files Browse the repository at this point in the history
  • Loading branch information
Solxanich committed Feb 4, 2024
1 parent db79f6a commit 13b2d72
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion patches/tModLoader/Terraria/Main.TML.cs
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,21 @@ internal void InitTMLContentManager()
if (SocialAPI.Mode == SocialMode.Steam) {
vanillaContentFolder = Path.Combine(Steam.GetSteamTerrariaInstallDir(), "Content");
}
else {
else if (InstallVerifier.DistributionPlatform == DistributionPlatform.GoG) {
vanillaContentFolder = Path.Combine(Path.GetDirectoryName(InstallVerifier.vanillaExePath), "Content");
Logging.tML.Info("Content folder of Terraria GOG Install Location assumed to be: " + Path.GetFullPath(vanillaContentFolder));
}
// Explicitly path if we are family shared using the old logic from prior to #4018; Temporary Hotfix - Solxan
// Maybe replace with a call to get InstallDir from TerrariaSteamClient? Or change Steam.GetInstallDir to be 'FamilyShare' safe?
// Also left as a generic fallback
else /*if (Social.Steam.SteamedWraps.FamilyShared)*/ {
vanillaContentFolder = Platform.IsOSX ? "../Terraria/Terraria.app/Contents/Resources/Content" : "../Terraria/Content"; // Side-by-Side Manual Install

if (!Directory.Exists(vanillaContentFolder)) {
vanillaContentFolder = Platform.IsOSX ? "../Terraria.app/Contents/Resources/Content" : "../Content"; // Nested Manual Install
}
}


if (!Directory.Exists(vanillaContentFolder)) {
ErrorReporting.FatalExit(Language.GetTextValue("tModLoader.ContentFolderNotFound"));
Expand Down

0 comments on commit 13b2d72

Please sign in to comment.