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

Fix Grenades not exploding. Fuse time is really long for some reason thanks bsg :)

This commit is contained in:
Kaeno 2024-08-01 21:13:43 +01:00
parent 5d2237092b
commit 104cb02b58
2 changed files with 43 additions and 1 deletions

View 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;
}
}
}

View File

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