ACTUALLY fix Viper

This commit is contained in:
Pietro420 committed 2025-09-14 20:07:17 -03:00
1 parent 790d868759
commit f3175990d3
1 file changed
+7 -11
+7 -11
View File
@@ -105,20 +105,16 @@ internal static class PlayerControlPatches
return;
}
__instance.isKilling = true;
__instance.RpcMurderPlayer(target, true);
}
[HarmonyPrefix]
[HarmonyPatch(nameof(PlayerControl.RpcMurderPlayer))]
// ReSharper disable once InconsistentNaming
// Note: This method is partially inlined in 2025.5.20 but we already use custom murder RPCs.
public static void PlayerControlMurderPrefix(PlayerControl __instance, PlayerControl target, ref bool didSucceed)
{
var beforeMurderEvent = new BeforeMurderEvent(__instance, target);
MiraEventManager.InvokeEvent(beforeMurderEvent);
didSucceed = beforeMurderEvent.IsCancelled;
if (beforeMurderEvent.IsCancelled)
{
return;
}
__instance.isKilling = true;
__instance.RpcMurderPlayer(target, true);
}
[HarmonyPostfix]