fixes issue with detecting fileswaps

This commit is contained in:
rootdarkarchon
2023-03-15 01:48:25 +01:00
parent f17c1b7dd8
commit a206d7c0cc

View File

@@ -22,7 +22,7 @@ public partial class FileReplacement
public bool HasFileReplacement => GamePaths.Count >= 1 && GamePaths.Any(p => !string.Equals(p, ResolvedPath, StringComparison.Ordinal));
public string Hash => _hashLazy.Value;
public bool IsFileSwap => !LocalPathRegex().IsMatch(ResolvedPath) && !string.Equals(GamePaths.First(), ResolvedPath, StringComparison.Ordinal);
public bool IsFileSwap => !LocalPathRegex().IsMatch(ResolvedPath) && GamePaths.All(p => !LocalPathRegex().IsMatch(p));
public string ResolvedPath { get; init; }
public FileReplacementData ToFileReplacementDto()
@@ -37,7 +37,7 @@ public partial class FileReplacement
public override string ToString()
{
return $"Modded: {HasFileReplacement} - {string.Join(",", GamePaths)} => {ResolvedPath}";
return $"HasReplacement:{HasFileReplacement},IsFileSwap:{IsFileSwap} - {string.Join(",", GamePaths)} => {ResolvedPath}";
}
[GeneratedRegex(@"^[a-zA-Z]:(/|\\)", RegexOptions.ECMAScript)]