Skip to content

Commit

Permalink
Fix def mismatches again
Browse files Browse the repository at this point in the history
  • Loading branch information
Zetrith committed Nov 5, 2022
1 parent a791c66 commit 13220a2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Source/Client/EarlyPatches/EarlyPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ static class XmlAssetsInModFolderPatch
static void Postfix(LoadableXmlAsset[] __result)
{
// This compares by absolute paths but they all have a common prefix
Array.Sort(__result, (x, y) => StringComparer.OrdinalIgnoreCase.Compare(x.FullFilePath, y.FullFilePath));
// Ignore non-alphanumeric chars (only slashes?) as they might be different between OSes
Array.Sort(__result, (x, y) =>
StringComparer.OrdinalIgnoreCase.Compare(OnlyAlphanumeric(x.FullFilePath), OnlyAlphanumeric(y.FullFilePath)));
}

static string OnlyAlphanumeric(string str)
{
return new string(str.Where(char.IsLetterOrDigit).ToArray());
}
}

Expand Down

0 comments on commit 13220a2

Please sign in to comment.