From 81a970012fdb9f3c346c5e19ab4f69b04bdad49e Mon Sep 17 00:00:00 2001 From: D1GQ Date: Sat, 27 Jul 2024 18:43:17 -0500 Subject: [PATCH] NoisemakerRolePatch --- .gitignore | 3 +++ Patches/RolePatch.cs | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 Patches/RolePatch.cs diff --git a/.gitignore b/.gitignore index e915029..e711062 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,7 @@ # This .gitignore file was automatically created by Microsoft(R) Visual Studio. ################################################################################ +/BetterAmongUs.csproj /.vs +/bin/Debug/net6.0 +/obj diff --git a/Patches/RolePatch.cs b/Patches/RolePatch.cs new file mode 100644 index 0000000..ab3e093 --- /dev/null +++ b/Patches/RolePatch.cs @@ -0,0 +1,22 @@ +using HarmonyLib; + +namespace BetterAmongUs.Patches; + +class RolePatch +{ + [HarmonyPatch(typeof(NoisemakerRole))] + class NoisemakerRolePatch + { + [HarmonyPatch(nameof(NoisemakerRole.OnDeath))] + [HarmonyPrefix] + public static bool NotifyOfDeath_Prefix(NoisemakerRole __instance) + { + if (__instance.Player == null || !__instance.Player.IsAlive()) + { + return false; + } + + return true; + } + } +}