From 2eb7cb3ecab7adbb6dfa650760801897347e5b41 Mon Sep 17 00:00:00 2001 From: Kaeno Date: Thu, 1 Aug 2024 22:09:28 +0100 Subject: [PATCH] Remove grenade patches --- .../Patches/StunGrenadeExplosionPatch.cs | 41 ------------------- project/SPT.Custom/SPTCustomPlugin.cs | 2 - .../Patches/ScavMode/EnablePlayerScavPatch.cs | 8 +--- 3 files changed, 2 insertions(+), 49 deletions(-) delete mode 100644 project/SPT.Custom/Patches/StunGrenadeExplosionPatch.cs diff --git a/project/SPT.Custom/Patches/StunGrenadeExplosionPatch.cs b/project/SPT.Custom/Patches/StunGrenadeExplosionPatch.cs deleted file mode 100644 index ceca1ca..0000000 --- a/project/SPT.Custom/Patches/StunGrenadeExplosionPatch.cs +++ /dev/null @@ -1,41 +0,0 @@ -using HarmonyLib; -using SPT.Reflection.Patching; -using System; -using System.Reflection; - -namespace SPT.Custom.Patches -{ - /// - /// BSG has had the wonderful idea of not letting grenades explode. - /// Waiting on BSG Fix. - /// - public class StunGrenadeExplosionPatch : ModulePatch - { - protected override MethodBase GetTargetMethod() - { - return AccessTools.Method(typeof(ObservedStunGrenade), nameof(ObservedStunGrenade.StartTimer)); - } - - [PatchPrefix] - private static bool PatchPrefix(ObservedStunGrenade __instance, float ___float_4) - { - __instance.StartBehaviourTimer(__instance.WeaponSource.GetExplDelay - ___float_4, new Action(__instance.InvokeBlowUpEvent)); - return false; - } - } - - public class GrenadeExplosionPatch : ModulePatch - { - protected override MethodBase GetTargetMethod() - { - return AccessTools.Method(typeof(ObservedGrenade), nameof(ObservedGrenade.StartTimer)); - } - - [PatchPrefix] - private static bool PatchPrefix(ObservedGrenade __instance, float ___float_4) - { - __instance.StartBehaviourTimer(__instance.WeaponSource.GetExplDelay - ___float_4, new Action(__instance.InvokeBlowUpEvent)); - return false; - } - } -} diff --git a/project/SPT.Custom/SPTCustomPlugin.cs b/project/SPT.Custom/SPTCustomPlugin.cs index d383ee9..4f3b2b7 100644 --- a/project/SPT.Custom/SPTCustomPlugin.cs +++ b/project/SPT.Custom/SPTCustomPlugin.cs @@ -53,8 +53,6 @@ namespace SPT.Custom new LocationLootCacheBustingPatch().Enable(); new VersionLabelPatch().Enable(); new FixBotgroupMarkofTheUnknown().Enable(); - new StunGrenadeExplosionPatch().Enable(); - new GrenadeExplosionPatch().Enable(); HookObject.AddOrGetComponent(); } diff --git a/project/SPT.SinglePlayer/Patches/ScavMode/EnablePlayerScavPatch.cs b/project/SPT.SinglePlayer/Patches/ScavMode/EnablePlayerScavPatch.cs index e5f089d..8c261ca 100644 --- a/project/SPT.SinglePlayer/Patches/ScavMode/EnablePlayerScavPatch.cs +++ b/project/SPT.SinglePlayer/Patches/ScavMode/EnablePlayerScavPatch.cs @@ -9,9 +9,6 @@ namespace SPT.SinglePlayer.Patches.ScavMode { public class EnablePlayerScavPatch : ModulePatch { - - private static RaidSettings StoredRaidsettings { get; set; } - private static RaidSettings StoredRaidsettings1 { get; set; } /// /// Modifys the raidsettings to retain raidsettings options in menu and allows scav to load into raid /// @@ -23,18 +20,17 @@ namespace SPT.SinglePlayer.Patches.ScavMode [PatchPrefix] private static void PatchPrefix(ref RaidSettings ___raidSettings_0, ref RaidSettings ___raidSettings_1, MainMenuController __instance) { - StoredRaidsettings = ___raidSettings_0; - StoredRaidsettings1 = ___raidSettings_1; ___raidSettings_0.RaidMode = ERaidMode.Local; ___raidSettings_0.IsPveOffline = true; ___raidSettings_0.WavesSettings = ___raidSettings_1.WavesSettings; ___raidSettings_0.BotSettings = ___raidSettings_1.BotSettings; ___raidSettings_1.Apply(___raidSettings_0); } + [PatchPostfix] private static void PatchPostfix(ref RaidSettings ___raidSettings_0) { - ___raidSettings_0.RaidMode = ERaidMode.Online; + ___raidSettings_0.RaidMode = ERaidMode.Local; ___raidSettings_0.IsPveOffline = true; } }