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; + } + } +}