Skip to content

Commit

Permalink
[MPQ] Fixed Linux case sensitive paths
Browse files Browse the repository at this point in the history
  • Loading branch information
BAndysc committed Aug 21, 2022
1 parent 69e7d38 commit 96c83b6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions WDE.MPQ/Services/MpqService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ public IMpqArchive Open()
{
if (settings.Path == null)
return new EmptyMpqArchive();
var files = Directory.EnumerateFiles(Path.Join(settings.Path, "Data"), "*.mpq", SearchOption.AllDirectories).ToList();
var files = Directory.EnumerateFiles(Path.Join(settings.Path, "Data"), "*.mpq", new EnumerationOptions { RecurseSubdirectories = true, MatchType = MatchType.Win32, AttributesToSkip = 0, IgnoreInaccessible = true, MatchCasing = MatchCasing.CaseInsensitive})
.Where(x => !x.Contains("-update-"))
.ToList();
files.Sort(MpqSortingFunc);
List<IMpqArchive> archives = new();
foreach (var file in files)
Expand Down Expand Up @@ -81,4 +83,4 @@ public void Dispose() { }
public IMpqArchive Clone() => new EmptyMpqArchive();
}
}
}
}

0 comments on commit 96c83b6

Please sign in to comment.