Skip to content

Commit 0c0967d

Browse files
authored
Merge pull request #75 from Hxs1990/master
Fix china version cause bug at Tools.VersionAsInt.
2 parents 8b70199 + 9662a47 commit 0c0967d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

UnityLauncherPro/Tools.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Microsoft.Win32;
1+
using Microsoft.Win32;
22
using System;
33
using System.Collections.Generic;
44
using System.Diagnostics;
@@ -481,7 +481,8 @@ public static bool VersionIsAlpha(string version)
481481

482482
public static bool VersionIsChinese(string version)
483483
{
484-
return version.Contains("c1");
484+
// return version.Contains("c1");
485+
return Regex.IsMatch(version, "c\\d+");
485486
}
486487

487488
// open release notes page in browser
@@ -642,7 +643,8 @@ public static int VersionAsInt(string version)
642643
// remove a,b,f,p
643644
cleanVersion = cleanVersion.Replace("a", ".");
644645
cleanVersion = cleanVersion.Replace("b", ".");
645-
cleanVersion = cleanVersion.Replace("c1", "");
646+
// cleanVersion = cleanVersion.Replace("c1", "");
647+
cleanVersion = Regex.Replace(cleanVersion, "c\\d+", "");
646648
cleanVersion = cleanVersion.Replace("f", ".");
647649
cleanVersion = cleanVersion.Replace("p", ".");
648650

0 commit comments

Comments
 (0)