diff --git a/EXILED/Exiled.Events/Patches/Events/Player/DryFire.cs b/EXILED/Exiled.Events/Patches/Events/Player/DryFire.cs index 59b209e10..9ea721c3b 100644 --- a/EXILED/Exiled.Events/Patches/Events/Player/DryFire.cs +++ b/EXILED/Exiled.Events/Patches/Events/Player/DryFire.cs @@ -12,17 +12,15 @@ namespace Exiled.Events.Patches.Events.Player #pragma warning disable SA1649 using System.Collections.Generic; using System.Linq; - using System.Reflection; using System.Reflection.Emit; - using Exiled.API.Extensions; - using Exiled.API.Features.Pools; + using Attributes; - using Exiled.Events.Attributes; + using Exiled.API.Features.Pools; using Exiled.Events.EventArgs.Player; - using Exiled.Events.Handlers; + using Handlers; using HarmonyLib; @@ -67,7 +65,7 @@ private static IEnumerable Transpiler(IEnumerable x.Calls(PropertyGetter(typeof(AutomaticActionModule), nameof(AutomaticActionModule.Cocked)))) + offset; + int index = newInstructions.FindLastIndex(x => x.Calls(PropertySetter(typeof(AutomaticActionModule), nameof(AutomaticActionModule.Cocked)))) + offset; newInstructions.InsertRange(index, GetInstructions(newInstructions[index], ret)); @@ -78,6 +76,7 @@ private static IEnumerable Transpiler(IEnumerable Commented out, because it is never called (nw moment). Calls 2 PumpActionModule.ShootOneBarrel(bool) instead. /// /// Patches /// to add event for double shots. @@ -102,10 +101,11 @@ private static IEnumerable Transpiler(IEnumerable.Pool.Return(newInstructions); } } + */ /// - /// Patches - /// to add event for double shots. + /// Patches + /// to add event for pump shots. /// [EventPatch(typeof(Player), nameof(Player.DryfiringWeapon))] [HarmonyPatch(typeof(PumpActionModule), nameof(PumpActionModule.ShootOneBarrel))]