Skip to content

Commit

Permalink
Version handling hotfix
Browse files Browse the repository at this point in the history
Prevents harmony from patching if mod loader version is out of date
  • Loading branch information
Raidriar796 committed Feb 11, 2024
1 parent 9172633 commit 6a68422
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
17 changes: 14 additions & 3 deletions IKCulling/ResoniteIKCulling.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,21 @@ public class IkCulling : ResoniteMod

public override string Name => "ResoniteIkCulling";
public override string Author => "Raidriar796 & KyuubiYoru";
public override string Version => "2.6.0";
public override string Version => "2.6.1";
public override string Link => "https://github.com/Raidriar796/ResoniteIkCulling";

public override void OnEngineInit()
{
try
{
Harmony harmony = new Harmony("net.raidriar796.ResoniteIkCulling");
harmony.PatchAll();
if (ModLoader.VERSION == "2.4.0") OutOfDateNotifier();
else if (ModLoader.VERSION == "2.5.0") OutOfDateNotifier();
else if (ModLoader.VERSION == "2.5.1") OutOfDateNotifier();
else
{
Harmony harmony = new Harmony("net.raidriar796.ResoniteIkCulling");
harmony.PatchAll();
}

Config = GetConfiguration();

Expand Down Expand Up @@ -158,6 +164,11 @@ public override void OnEngineInit()
IkUpdateFalloff.OnChanged += (value) => { UpdateFalloff(); };
}

public static void OutOfDateNotifier()
{
Msg("Mod loader version out of date, please update to version 2.6.0 or later");
}

//Variables
private static Headset UserHeadset = Headset.Unknown;
private static float FOVDegToDot = 0f;
Expand Down
6 changes: 3 additions & 3 deletions IKCulling/ResoniteIKCulling.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<AssemblyTitle>ResoniteIKCulling</AssemblyTitle>
<Authors>Raidriar796</Authors>
<Copyright>Copyright © 2024 Raidriar796</Copyright>
<Version>2.6.0</Version>
<AssemblyVersion>2.6.0.0</AssemblyVersion>
<FileVersion>2.6.0.0</FileVersion>
<Version>2.6.1</Version>
<AssemblyVersion>2.6.1.0</AssemblyVersion>
<FileVersion>2.6.1.0</FileVersion>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<TargetFramework>net472</TargetFramework>
<FileAlignment>512</FileAlignment>
Expand Down

0 comments on commit 6a68422

Please sign in to comment.