Skip to content

Commit

Permalink
Consider all KSP 1.12 revisions the same in compatibility checks (#2972)
Browse files Browse the repository at this point in the history
  • Loading branch information
siimav authored Jun 19, 2024
1 parent 7830f68 commit 1807df9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Source/Harmony/KSPUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,17 @@ internal static bool Prefix_PrintSI(double amount, string unitName, int sigFigs,
__result = ResourceUnits.PrintSI(amount, unitName, sigFigs, longPrefix);
return false;
}

[HarmonyPostfix]
[HarmonyPatch("CheckVersion", typeof(int), typeof(int), typeof(int), typeof(int), typeof(int), typeof(int))]
internal static void CheckVersion(int version_major, int version_minor, int version_revision, int lastMajor, int lastMinor, int lastRev, ref VersionCompareResult __result)
{
// it's silly to differentiate between KSP 1.12 revisions
if (__result == VersionCompareResult.INCOMPATIBLE_TOO_LATE &&
version_major == 1 && version_minor == 12)
{
__result = VersionCompareResult.COMPATIBLE;
}
}
}
}

0 comments on commit 1807df9

Please sign in to comment.