Fix fatal crash in Unity version parsing for non-English locales

This commit is contained in:
Katy Coe
2020-07-12 19:23:18 +02:00
parent 5e69095e89
commit 3c4908c470

View File

@@ -9,6 +9,7 @@ using System.Reflection;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Globalization;
namespace Il2CppInspector.Cpp.UnityHeaders
{
@@ -28,7 +29,7 @@ namespace Il2CppInspector.Cpp.UnityHeaders
private UnityHeader(string headerFilename) {
HeaderFilename = headerFilename;
var bits = headerFilename.Replace(".h", "").Split("-");
MetadataVersion = double.Parse(bits[0]);
MetadataVersion = double.Parse(bits[0], NumberFormatInfo.InvariantInfo);
MinVersion = new UnityVersion(bits[1]);
if (bits.Length == 2)
MaxVersion = MinVersion;