0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 01:30:45 -05:00

Remove grenade patches

This commit is contained in:
Kaeno 2024-08-01 22:09:28 +01:00
parent 9b86d8624a
commit 2eb7cb3eca
3 changed files with 2 additions and 49 deletions

View File

@ -1,41 +0,0 @@
using HarmonyLib;
using SPT.Reflection.Patching;
using System;
using System.Reflection;
namespace SPT.Custom.Patches
{
/// <summary>
/// BSG has had the wonderful idea of not letting grenades explode.
/// Waiting on BSG Fix.
/// </summary>
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;
}
}
}

View File

@ -53,8 +53,6 @@ namespace SPT.Custom
new LocationLootCacheBustingPatch().Enable();
new VersionLabelPatch().Enable();
new FixBotgroupMarkofTheUnknown().Enable();
new StunGrenadeExplosionPatch().Enable();
new GrenadeExplosionPatch().Enable();
HookObject.AddOrGetComponent<MenuNotificationManager>();
}

View File

@ -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; }
/// <summary>
/// Modifys the raidsettings to retain raidsettings options in menu and allows scav to load into raid
/// </summary>
@ -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;
}
}