From f49dfbdb011b51a0ff8516dd15b0a8517b7e0768 Mon Sep 17 00:00:00 2001 From: Terkoiz Date: Tue, 9 Jul 2024 00:06:17 +0300 Subject: [PATCH] Updated for SPT 3.9.0 --- .gitignore | 1 + project/References/SPT/.keep | 0 project/Terkoiz.Freecam/FallDamagePatch.cs | 4 ++-- project/Terkoiz.Freecam/Freecam.cs | 2 +- project/Terkoiz.Freecam/FreecamPatch.cs | 12 ++++++------ project/Terkoiz.Freecam/FreecamPlugin.cs | 2 +- project/Terkoiz.Freecam/Terkoiz.Freecam.csproj | 4 ++-- 7 files changed, 13 insertions(+), 12 deletions(-) create mode 100644 project/References/SPT/.keep diff --git a/.gitignore b/.gitignore index c6a0c3b..8a854e4 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ project/References/EFT_Managed/* # Allow these files, despite the rules above !project/References/EFT_Managed/.keep +!project/References/SPT/.keep # ---> VisualStudio ## Ignore Visual Studio temporary files, build results, and diff --git a/project/References/SPT/.keep b/project/References/SPT/.keep new file mode 100644 index 0000000..e69de29 diff --git a/project/Terkoiz.Freecam/FallDamagePatch.cs b/project/Terkoiz.Freecam/FallDamagePatch.cs index ce57c82..dc27e7c 100644 --- a/project/Terkoiz.Freecam/FallDamagePatch.cs +++ b/project/Terkoiz.Freecam/FallDamagePatch.cs @@ -1,5 +1,5 @@ using System.Reflection; -using Aki.Reflection.Patching; +using SPT.Reflection.Patching; using EFT.HealthSystem; using HarmonyLib; @@ -11,7 +11,7 @@ namespace Terkoiz.Freecam protected override MethodBase GetTargetMethod() { - return AccessTools.Method(typeof(ActiveHealthController), "HandleFall"); + return AccessTools.Method(typeof(ActiveHealthController), nameof(ActiveHealthController.HandleFall)); } [PatchPrefix] diff --git a/project/Terkoiz.Freecam/Freecam.cs b/project/Terkoiz.Freecam/Freecam.cs index 9d92586..3eb4c34 100644 --- a/project/Terkoiz.Freecam/Freecam.cs +++ b/project/Terkoiz.Freecam/Freecam.cs @@ -6,7 +6,7 @@ namespace Terkoiz.Freecam /// /// A simple free camera to be added to a Unity game object. /// - /// Full credit to Ashley Davis on GitHub for the inital code: + /// Full credit to Ashley Davis on GitHub for the initial code: /// https://gist.github.com/ashleydavis/f025c03a9221bc840a2b /// /// diff --git a/project/Terkoiz.Freecam/FreecamPatch.cs b/project/Terkoiz.Freecam/FreecamPatch.cs index eae6a1a..6f213b8 100644 --- a/project/Terkoiz.Freecam/FreecamPatch.cs +++ b/project/Terkoiz.Freecam/FreecamPatch.cs @@ -1,5 +1,5 @@ using System.Reflection; -using Aki.Reflection.Patching; +using SPT.Reflection.Patching; using Comfort.Common; using EFT; using HarmonyLib; @@ -10,19 +10,19 @@ namespace Terkoiz.Freecam { protected override MethodBase GetTargetMethod() { - return AccessTools.Method(typeof(GameWorld), "OnGameStarted"); + return AccessTools.Method(typeof(GameWorld), nameof(GameWorld.OnGameStarted)); } [PatchPostfix] public static void PatchPostFix() { - var gameworld = Singleton.Instance; + var gameWorld = Singleton.Instance; - if (gameworld == null) + if (gameWorld == null) return; - // Add FreeCamController to GameWorld GameObject - gameworld.gameObject.AddComponent(); + // Add FreecamController to GameWorld GameObject + gameWorld.gameObject.AddComponent(); } } } \ No newline at end of file diff --git a/project/Terkoiz.Freecam/FreecamPlugin.cs b/project/Terkoiz.Freecam/FreecamPlugin.cs index 6479332..a840ee2 100644 --- a/project/Terkoiz.Freecam/FreecamPlugin.cs +++ b/project/Terkoiz.Freecam/FreecamPlugin.cs @@ -7,7 +7,7 @@ using KeyboardShortcut = BepInEx.Configuration.KeyboardShortcut; namespace Terkoiz.Freecam { - [BepInPlugin("com.terkoiz.freecam", "Terkoiz.Freecam", "1.4.3")] + [BepInPlugin("com.terkoiz.freecam", "Terkoiz.Freecam", "1.4.4")] public class FreecamPlugin : BaseUnityPlugin { internal new static ManualLogSource Logger { get; private set; } diff --git a/project/Terkoiz.Freecam/Terkoiz.Freecam.csproj b/project/Terkoiz.Freecam/Terkoiz.Freecam.csproj index 30f56ab..8aed889 100644 --- a/project/Terkoiz.Freecam/Terkoiz.Freecam.csproj +++ b/project/Terkoiz.Freecam/Terkoiz.Freecam.csproj @@ -2,7 +2,7 @@ net471 - 1.4.2 + 1.4.4 Terkoiz, Kobrakon, CWX https://dev.sp-tarkov.com/Terkoiz/Freecam NCSA @@ -16,7 +16,7 @@ - ..\References\EFT_Managed\Aki.Reflection.dll + ..\References\SPT\spt-reflection.dll False