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),