Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.

Commit b9e2d67

Browse files
committed
Fix min version check
1 parent 4654248 commit b9e2d67

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

ModLoader/Loader.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ private bool verifyVersion(string version1, string version2, bool checkMinVersio
315315
string[] target1 = version1.Split('.');
316316
string[] target2 = version2.Split('.');
317317
int num1, num2;
318+
bool minor = false;
318319
if (target1.Length == target2.Length)
319320
{
320321
for (short index = 0; index < target2.Length; index++)
@@ -323,18 +324,22 @@ private bool verifyVersion(string version1, string version2, bool checkMinVersio
323324
{
324325
continue;
325326
}
326-
327+
// check if version1 is MIN that version2
327328
if (checkMinVersion)
328329
{
329-
330+
// the previous section was MIN, if it was min the rest are MIN too
331+
if (minor)
332+
{
333+
continue;
334+
}
330335
if (int.TryParse(target1[index], out num1))
331336
{
332337
if(int.TryParse(target2[index], out num2))
333338
{
334-
335-
if(num1 <= num2)
339+
// the version1 section is MIN that version 2 section
340+
if(num1 < num2)
336341
{
337-
342+
minor = true;
338343
continue;
339344
}
340345
}

0 commit comments

Comments
 (0)