diff --git a/IPA.Loader/Utilities/AlmostVersion.cs b/IPA.Loader/Utilities/AlmostVersion.cs index a9527503..494090e9 100644 --- a/IPA.Loader/Utilities/AlmostVersion.cs +++ b/IPA.Loader/Utilities/AlmostVersion.cs @@ -10,7 +10,7 @@ using Version = Hive.Versioning.Version; namespace IPA.Utilities { /// - /// A type that wraps so that the string of the version is stored when the string is + /// A type that wraps so that the string of the version is stored when the string is /// not a valid . /// public class AlmostVersion : IComparable, IComparable, @@ -61,7 +61,7 @@ namespace IPA.Utilities public AlmostVersion(SVersion ver) : this(ver?.UnderlyingVersion ?? throw new ArgumentNullException(nameof(ver))) { } /// - /// Creates an from the version string in stored using + /// Creates an from the version string in stored using /// the storage mode specified in . /// /// the text to parse as an @@ -92,7 +92,13 @@ namespace IPA.Utilities if (mode == StoredAs.SemVer) { StorageMode = StoredAs.SemVer; +#if BeatSaber + var index = str.IndexOf('_'); + var versionString = index >= 0 ? str.Substring(0, index) : str; + var result = Version.TryParse(versionString, out var version); +#else var result = Version.TryParse(str, out var version); +#endif SemverValue = version; return result; }