diff --git a/IPA.Loader/Loader/PluginManager.cs b/IPA.Loader/Loader/PluginManager.cs
index 8febf337..cad6dd88 100644
--- a/IPA.Loader/Loader/PluginManager.cs
+++ b/IPA.Loader/Loader/PluginManager.cs
@@ -296,7 +296,7 @@ namespace IPA.Loader
var lastVerS = SelfConfig.SelfConfigRef.Value.LastGameVersion;
var lastVer = lastVerS != null ? new SemVer.Version(lastVerS, true) : null;
- if (lastVer != null && gameVer != lastVer)
+ if (lastVer != null && Utils.VersionCompareNoPrerelease(gameVer, lastVer) != 0)
{
var oldPluginsName = Path.Combine(BeatSaber.InstallPath, $"Old {lastVer} Plugins");
var newPluginsName = Path.Combine(BeatSaber.InstallPath, $"Old {gameVer} Plugins");
diff --git a/IPA.Loader/Utilities/Utils.cs b/IPA.Loader/Utilities/Utils.cs
index a9147d86..6f71ecd1 100644
--- a/IPA.Loader/Utilities/Utils.cs
+++ b/IPA.Loader/Utilities/Utils.cs
@@ -166,5 +166,21 @@ namespace IPA.Utilities
else return DateTime.MinValue.AddTicks((long)UnsafeAdvanceTicks++); // return MinValue as a fallback
}
}
+
+ ///
+ /// Compares a pair of s ignoring both the prerelease and build fields.
+ ///
+ /// the left value
+ /// the right value
+ /// -1 if l is less than r, 0 if they are equal in the numeric portion, or 1 if l is greater than r
+ public static int VersionCompareNoPrerelease(SemVer.Version l, SemVer.Version r)
+ {
+ var cmpVal = l.Major - r.Major;
+ if (cmpVal != 0) return cmpVal;
+ cmpVal = l.Minor - r.Minor;
+ if (cmpVal != 0) return cmpVal;
+ cmpVal = l.Patch - r.Patch;
+ return cmpVal;
+ }
}
}