Skip to content

Commit

Permalink
Make script paths in .luases relative to .luases path
Browse files Browse the repository at this point in the history
Restore behavior before 99dc0e0
  • Loading branch information
kalimag authored and YoshiRulz committed Dec 7, 2022
1 parent df4df51 commit 01ab941
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/BizHawk.Client.Common/lua/LuaFileList.cs
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Text;
using BizHawk.Common.PathExtensions;

namespace BizHawk.Client.Common
{
Expand Down Expand Up @@ -107,6 +108,7 @@ public void Save(string path)
{
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)
Expand All @@ -118,7 +120,7 @@ public void Save(string path)
sb
.Append(file.Enabled ? "1" : "0")
.Append(' ')
.Append(file.Path)
.Append(file.Path.MakeRelativeTo(saveDirectory))
.AppendLine();
}
}
Expand Down

0 comments on commit 01ab941

Please sign in to comment.