mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:50:43 -05:00
Fix Grenades not exploding. Fuse time is really long for some reason thanks bsg :)
This commit is contained in:
parent
5d2237092b
commit
104cb02b58
40
project/SPT.Custom/Patches/StunGrenadeExplosionPatch.cs
Normal file
40
project/SPT.Custom/Patches/StunGrenadeExplosionPatch.cs
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
using HarmonyLib;
|
||||||
|
using SPT.Reflection.Patching;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace SPT.Custom.Patches
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// BSG has had the wonderful idea of not letting grenades explode. Delay for the grenades are really long for some reason.
|
||||||
|
/// Waiting on BSG Fix.
|
||||||
|
/// </summary>
|
||||||
|
public class StunGrenadeExplosionPatch : ModulePatch
|
||||||
|
{
|
||||||
|
protected override MethodBase GetTargetMethod()
|
||||||
|
{
|
||||||
|
return AccessTools.Method(typeof(ObservedStunGrenade), nameof(ObservedStunGrenade.method_4));
|
||||||
|
}
|
||||||
|
|
||||||
|
[PatchPrefix]
|
||||||
|
private static bool PatchPrefix(ObservedStunGrenade __instance)
|
||||||
|
{
|
||||||
|
__instance.InvokeBlowUpEvent();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GrenadeExplosionPatch : ModulePatch
|
||||||
|
{
|
||||||
|
protected override MethodBase GetTargetMethod()
|
||||||
|
{
|
||||||
|
return AccessTools.Method(typeof(ObservedGrenade), nameof(ObservedGrenade.method_4));
|
||||||
|
}
|
||||||
|
|
||||||
|
[PatchPrefix]
|
||||||
|
private static bool PatchPrefix(ObservedGrenade __instance)
|
||||||
|
{
|
||||||
|
__instance.InvokeBlowUpEvent();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -53,6 +53,8 @@ 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>();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user