Take in account ForcedAutorun for legacy as well

This commit is contained in:
Evil Factory
2026-01-29 22:05:32 -03:00
committed by Maplewheels
parent dfb31eef16
commit 6b8a0a7dca
@@ -323,13 +323,17 @@ public sealed class ModConfigService : IModConfigService
if (_storageService.FindFilesInPackage(src, "Lua", "*.lua", true) if (_storageService.FindFilesInPackage(src, "Lua", "*.lua", true)
is { IsSuccess: true, Value.IsDefaultOrEmpty: false } result) is { IsSuccess: true, Value.IsDefaultOrEmpty: false } result)
{ {
var autorun = result.Value ImmutableArray<string> cleanedResult = result.Value.Select(fp => fp.CleanUpPathCrossPlatform()).ToImmutableArray();
.Where(fp => fp.CleanUpPathCrossPlatform().Contains("Lua/Autorun/"))
ImmutableArray<string> autorun = cleanedResult
.Where(fp => fp.Contains("Lua/ForcedAutorun/") || fp.Contains("Lua/Autorun/"))
.ToImmutableArray(); .ToImmutableArray();
var autorunFP = autorun.Select(fp => ContentPath.FromRaw(src,
ImmutableArray<ContentPath> autorunFP = autorun.Select(fp => ContentPath.FromRaw(src,
$"%ModDir%/{Path.GetRelativePath(src.Dir, fp)}".CleanUpPathCrossPlatform())) $"%ModDir%/{Path.GetRelativePath(src.Dir, fp)}".CleanUpPathCrossPlatform()))
.ToImmutableArray(); .ToImmutableArray();
var reg = result.Value.Except(autorun)
ImmutableArray<ContentPath> reg = cleanedResult.Except(autorun)
.Select(fp => ContentPath.FromRaw(src, .Select(fp => ContentPath.FromRaw(src,
$"%ModDir%/{Path.GetRelativePath(src.Dir, fp)}".CleanUpPathCrossPlatform())) $"%ModDir%/{Path.GetRelativePath(src.Dir, fp)}".CleanUpPathCrossPlatform()))
.ToImmutableArray(); .ToImmutableArray();