diff --git a/MiraAPI/Networking/CustomMurderRpc.cs b/MiraAPI/Networking/CustomMurderRpc.cs
index d31e185..0a31cf1 100644
--- a/MiraAPI/Networking/CustomMurderRpc.cs
+++ b/MiraAPI/Networking/CustomMurderRpc.cs
@@ -93,7 +93,12 @@ public static class CustomMurderRpc
beforeMurderEvent.Cancel();
}
- if (beforeMurderEvent.IsCancelled)
+ if (target.ProtectedByGa())
+ {
+ beforeMurderEvent.Cancel();
+ murderResultFlags = MurderResultFlags.FailedProtected;
+ }
+ else if (beforeMurderEvent.IsCancelled)
{
murderResultFlags = MurderResultFlags.FailedError;
}
diff --git a/MiraAPI/Utilities/Extensions.cs b/MiraAPI/Utilities/Extensions.cs
index 70f8c15..c45e4b2 100644
--- a/MiraAPI/Utilities/Extensions.cs
+++ b/MiraAPI/Utilities/Extensions.cs
@@ -156,6 +156,16 @@ public static class Extensions
return TutorialManager.InstanceExists || AmongUsClient.Instance.HostId == playerControl.OwnerId;
}
+ ///
+ /// Checks if a PlayerControl is protected by a Guardian Angel.
+ ///
+ /// The player you're checking for.
+ /// If the player is protected, true, else false.
+ public static bool ProtectedByGa(this PlayerControl playerControl)
+ {
+ return playerControl.protectedByGuardianId > -1;
+ }
+
///
/// Used to convert a System.Collections.Generic.List to Il2cppSystem.
///