mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 06:10:45 -05:00
Remove grenade patches
This commit is contained in:
parent
9b86d8624a
commit
2eb7cb3eca
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -53,8 +53,6 @@ namespace SPT.Custom
|
|||||||
new LocationLootCacheBustingPatch().Enable();
|
new LocationLootCacheBustingPatch().Enable();
|
||||||
new VersionLabelPatch().Enable();
|
new VersionLabelPatch().Enable();
|
||||||
new FixBotgroupMarkofTheUnknown().Enable();
|
new FixBotgroupMarkofTheUnknown().Enable();
|
||||||
new StunGrenadeExplosionPatch().Enable();
|
|
||||||
new GrenadeExplosionPatch().Enable();
|
|
||||||
|
|
||||||
HookObject.AddOrGetComponent<MenuNotificationManager>();
|
HookObject.AddOrGetComponent<MenuNotificationManager>();
|
||||||
}
|
}
|
||||||
|
@ -9,9 +9,6 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
|||||||
{
|
{
|
||||||
public class EnablePlayerScavPatch : ModulePatch
|
public class EnablePlayerScavPatch : ModulePatch
|
||||||
{
|
{
|
||||||
|
|
||||||
private static RaidSettings StoredRaidsettings { get; set; }
|
|
||||||
private static RaidSettings StoredRaidsettings1 { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Modifys the raidsettings to retain raidsettings options in menu and allows scav to load into raid
|
/// Modifys the raidsettings to retain raidsettings options in menu and allows scav to load into raid
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -23,18 +20,17 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
|||||||
[PatchPrefix]
|
[PatchPrefix]
|
||||||
private static void PatchPrefix(ref RaidSettings ___raidSettings_0, ref RaidSettings ___raidSettings_1, MainMenuController __instance)
|
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.RaidMode = ERaidMode.Local;
|
||||||
___raidSettings_0.IsPveOffline = true;
|
___raidSettings_0.IsPveOffline = true;
|
||||||
___raidSettings_0.WavesSettings = ___raidSettings_1.WavesSettings;
|
___raidSettings_0.WavesSettings = ___raidSettings_1.WavesSettings;
|
||||||
___raidSettings_0.BotSettings = ___raidSettings_1.BotSettings;
|
___raidSettings_0.BotSettings = ___raidSettings_1.BotSettings;
|
||||||
___raidSettings_1.Apply(___raidSettings_0);
|
___raidSettings_1.Apply(___raidSettings_0);
|
||||||
}
|
}
|
||||||
|
|
||||||
[PatchPostfix]
|
[PatchPostfix]
|
||||||
private static void PatchPostfix(ref RaidSettings ___raidSettings_0)
|
private static void PatchPostfix(ref RaidSettings ___raidSettings_0)
|
||||||
{
|
{
|
||||||
___raidSettings_0.RaidMode = ERaidMode.Online;
|
___raidSettings_0.RaidMode = ERaidMode.Local;
|
||||||
___raidSettings_0.IsPveOffline = true;
|
___raidSettings_0.IsPveOffline = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user