Skip to content

Commit 01ab941

Browse files
kalimagYoshiRulz
authored andcommitted
Make script paths in .luases relative to .luases path
Restore behavior before 99dc0e0
1 parent df4df51 commit 01ab941

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/BizHawk.Client.Common/lua/LuaFileList.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.IO;
44
using System.Text;
5+
using BizHawk.Common.PathExtensions;
56

67
namespace BizHawk.Client.Common
78
{
@@ -107,6 +108,7 @@ public void Save(string path)
107108
{
108109
using var sw = new StreamWriter(path);
109110
var sb = new StringBuilder();
111+
var saveDirectory = Path.GetDirectoryName(Path.GetFullPath(path));
110112
foreach (var file in this)
111113
{
112114
if (file.IsSeparator)
@@ -118,7 +120,7 @@ public void Save(string path)
118120
sb
119121
.Append(file.Enabled ? "1" : "0")
120122
.Append(' ')
121-
.Append(file.Path)
123+
.Append(file.Path.MakeRelativeTo(saveDirectory))
122124
.AppendLine();
123125
}
124126
}

0 commit comments

Comments
 (0)