From 01ab9416b5dede3b1e374bfbc905d5ec119fa7ee Mon Sep 17 00:00:00 2001 From: kalimag Date: Wed, 7 Dec 2022 09:15:31 +0100 Subject: [PATCH] Make script paths in .luases relative to .luases path Restore behavior before 99dc0e03df4c4cd20420507a06dd9987cbdf7140 --- src/BizHawk.Client.Common/lua/LuaFileList.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/BizHawk.Client.Common/lua/LuaFileList.cs b/src/BizHawk.Client.Common/lua/LuaFileList.cs index 98077973bd..0910bc9805 100644 --- a/src/BizHawk.Client.Common/lua/LuaFileList.cs +++ b/src/BizHawk.Client.Common/lua/LuaFileList.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; using System.Text; +using BizHawk.Common.PathExtensions; namespace BizHawk.Client.Common { @@ -107,6 +108,7 @@ namespace BizHawk.Client.Common { using var sw = new StreamWriter(path); var sb = new StringBuilder(); + var saveDirectory = Path.GetDirectoryName(Path.GetFullPath(path)); foreach (var file in this) { if (file.IsSeparator) @@ -118,7 +120,7 @@ namespace BizHawk.Client.Common sb .Append(file.Enabled ? "1" : "0") .Append(' ') - .Append(file.Path) + .Append(file.Path.MakeRelativeTo(saveDirectory)) .AppendLine(); } }