mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
ACTUALLY fix Viper
This commit is contained in:
1 parent
790d868759
commit
f3175990d3
1 file changed
+7
-11
@@ -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]
|
||||
|
||||
Reference in new issue
Block a user