From 33470904fed06fd80b58b9063faa792b43bb73d2 Mon Sep 17 00:00:00 2001 From: Lojemiru <33508026+Lojemiru@users.noreply.github.com> Date: Thu, 22 Apr 2021 05:29:59 -0500 Subject: [PATCH] Fix update version checker --- AM2RLauncher/AM2RLauncher/LauncherUpdater.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/AM2RLauncher/AM2RLauncher/LauncherUpdater.cs b/AM2RLauncher/AM2RLauncher/LauncherUpdater.cs index b2c8edc..e521a41 100644 --- a/AM2RLauncher/AM2RLauncher/LauncherUpdater.cs +++ b/AM2RLauncher/AM2RLauncher/LauncherUpdater.cs @@ -87,9 +87,19 @@ namespace AM2RLauncher Uri realUri = response.ResponseUri; string onlineVersion = realUri.AbsoluteUri.Substring(realUri.AbsoluteUri.LastIndexOf('/') + 1); - string onlineVersionForCompare = onlineVersion.Replace(".", ""); + bool isCurrentVersionOutdated = false; - bool isCurrentVersionOutdated = int.Parse(version) < int.Parse(onlineVersionForCompare); + string[] localVersionArray = VERSION.Split('.'); + string[] onlineVersionArray = onlineVersion.Split('.'); + + for (int i = 0; i < localVersionArray.Length; i++) + { + if (int.Parse(onlineVersionArray[i]) > int.Parse(localVersionArray[i])) + { + isCurrentVersionOutdated = true; + break; + } + } if (isCurrentVersionOutdated) {