From f77e055aef590d95d097953f143d87e0d3e1f065 Mon Sep 17 00:00:00 2001 From: bcssov Date: Fri, 5 Jul 2024 21:16:52 +0200 Subject: [PATCH] Fix Irony not being able to recognize new json format properly to auto determine game paths --- src/IronyModManager.IO.Common/PathOperations.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/IronyModManager.IO.Common/PathOperations.cs b/src/IronyModManager.IO.Common/PathOperations.cs index 77ef7c35..a7f72c12 100644 --- a/src/IronyModManager.IO.Common/PathOperations.cs +++ b/src/IronyModManager.IO.Common/PathOperations.cs @@ -4,13 +4,14 @@ // Created : 09-12-2021 // // Last Modified By : Mario -// Last Modified On : 09-12-2021 +// Last Modified On : 07-05-2024 // *********************************************************************** // // Mario // // // *********************************************************************** + using System; using System.Collections.Generic; using System.IO; @@ -35,11 +36,12 @@ public static class PathOperations public static string ResolveRelativePath(string basePath, string path) { var result = ResolveRelativePath(basePath, path, false); - if ((!File.Exists(result) || !Directory.Exists(result)) && PathContainsRelativeSegments(path)) + if (!File.Exists(result) && !Directory.Exists(result) && PathContainsRelativeSegments(path)) { // Fallback result = ResolveRelativePath(basePath, path, true); } + return result; } @@ -69,15 +71,17 @@ private static string ResolveRelativePath(string basePath, string path, bool che { basePath = Path.Combine(basePath, "dummy"); } + string result; if (string.IsNullOrWhiteSpace(basePath) || !Path.IsPathFullyQualified(basePath)) { - result = Path.Combine(basePath, path); + result = Path.Combine(basePath!, path); } else { result = Path.GetFullPath(path, basePath); } + return result; }