From e1ca50be3ec9588637e17df5bf69aaefaf8bbd78 Mon Sep 17 00:00:00 2001 From: Atony <75191600+AtonyGit@users.noreply.github.com> Date: Sat, 1 Nov 2025 10:00:42 -0500 Subject: [PATCH] Vanilla roles no longer bypass murder cancels --- MiraAPI/Networking/CustomMurderRpc.cs | 2 +- MiraAPI/Patches/Roles/KillButtonPatches.cs | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/MiraAPI/Networking/CustomMurderRpc.cs b/MiraAPI/Networking/CustomMurderRpc.cs index f94223b..710791a 100644 --- a/MiraAPI/Networking/CustomMurderRpc.cs +++ b/MiraAPI/Networking/CustomMurderRpc.cs @@ -87,11 +87,11 @@ public static class CustomMurderRpc bool playKillSound = true) { source.isKilling = false; - var data = target.Data; if (resultFlags.HasFlag(MurderResultFlags.FailedError)) { return; } + var data = target.Data; if (resultFlags.HasFlag(MurderResultFlags.FailedProtected) || (resultFlags.HasFlag(MurderResultFlags.DecisionByHost) && target.protectedByGuardianId > -1)) diff --git a/MiraAPI/Patches/Roles/KillButtonPatches.cs b/MiraAPI/Patches/Roles/KillButtonPatches.cs index 902a9e6..4001425 100644 --- a/MiraAPI/Patches/Roles/KillButtonPatches.cs +++ b/MiraAPI/Patches/Roles/KillButtonPatches.cs @@ -46,7 +46,7 @@ public static class KillButtonPatches } /// - /// Use Custom Murder if player is custom role. + /// Use Custom Murder instead of Murder Player from vanilla. /// [HarmonyPrefix] [HarmonyPatch(nameof(KillButton.DoClick))] @@ -58,11 +58,6 @@ public static class KillButtonPatches return false; } - if (PlayerControl.LocalPlayer.Data.Role is not ICustomRole) - { - return true; - } - PlayerControl.LocalPlayer.RpcCustomMurder(__instance.currentTarget); __instance.SetTarget(null);