From a25be5b4ab0a6384ff264ee019aa9c0251dd6e01 Mon Sep 17 00:00:00 2001 From: Undid-Iridium <24619207+Undid-Iridium@users.noreply.github.com> Date: Sun, 4 Aug 2024 03:25:56 -0400 Subject: [PATCH] Testing alternative. --- .../Patches/Generic/IndividualFriendlyFire.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/EXILED/Exiled.Events/Patches/Generic/IndividualFriendlyFire.cs b/EXILED/Exiled.Events/Patches/Generic/IndividualFriendlyFire.cs index b610cbb75..18d47060c 100644 --- a/EXILED/Exiled.Events/Patches/Generic/IndividualFriendlyFire.cs +++ b/EXILED/Exiled.Events/Patches/Generic/IndividualFriendlyFire.cs @@ -211,7 +211,7 @@ private static IEnumerable Transpiler(IEnumerable instruction.Calls(PropertyGetter(typeof(AttackerDamageHandler), nameof(AttackerDamageHandler.Attacker)))) + offset; + instruction => instruction.LoadsField(Field(typeof(ReferenceHub), nameof(ReferenceHub.networkIdentity)))) + offset; LocalBuilder ffMulti = generator.DeclareLocal(typeof(float)); @@ -220,7 +220,7 @@ private static IEnumerable Transpiler(IEnumerable Transpiler(IEnumerable instruction.opcode == OpCodes.Ret) + ffMultiplierIndexOffset; newInstructions.InsertRange( ffMultiplierIndex, - new CodeInstruction[] + new[] { // Do not run our custom logic, skip over. new(OpCodes.Br, normalProcessing), // AttackerDamageHandler.Damage = AttackerDamageHandler.Damage * ffMulti new CodeInstruction(OpCodes.Ldarg_0).WithLabels(uniqueFFMulti), - new(OpCodes.Ldloc, ffMulti.LocalIndex), + new (OpCodes.Ldloc, ffMulti.LocalIndex), new(OpCodes.Ldarg_0), new(OpCodes.Callvirt, PropertyGetter(typeof(AttackerDamageHandler), nameof(AttackerDamageHandler.Damage))), new(OpCodes.Mul),