From fc8261dee941d3fe7d6ffdd3bd905f951589a83f Mon Sep 17 00:00:00 2001 From: D1GQ Date: Sat, 3 Aug 2024 19:31:52 -0500 Subject: [PATCH] fix NoisemakerNotify --- Modules/AntiCheat.cs | 5 +++++ Modules/ExtendedPlayerInfo.cs | 1 + Patches/RolePatch.cs | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Modules/AntiCheat.cs b/Modules/AntiCheat.cs index 4af5782..37f3164 100644 --- a/Modules/AntiCheat.cs +++ b/Modules/AntiCheat.cs @@ -33,6 +33,11 @@ class AntiCheat { ExtendedPlayerInfo.TimesCalledMeeting.Clear(); } + + if (ExtendedPlayerInfo.HasNoisemakerNotify.Any()) + { + ExtendedPlayerInfo.HasNoisemakerNotify.Clear(); + } } if (GameStates.IsHost && GameStates.IsInGame) diff --git a/Modules/ExtendedPlayerInfo.cs b/Modules/ExtendedPlayerInfo.cs index 892cefd..857cb68 100644 --- a/Modules/ExtendedPlayerInfo.cs +++ b/Modules/ExtendedPlayerInfo.cs @@ -3,6 +3,7 @@ namespace BetterAmongUs; static class ExtendedPlayerInfo { + public static List HasNoisemakerNotify = []; public static Dictionary TimeSinceKill = []; public static Dictionary TimesCalledMeeting = []; private static Dictionary IsBetterUser = new Dictionary(); diff --git a/Patches/RolePatch.cs b/Patches/RolePatch.cs index ab3e093..34cc7d5 100644 --- a/Patches/RolePatch.cs +++ b/Patches/RolePatch.cs @@ -11,11 +11,13 @@ class RolePatch [HarmonyPrefix] public static bool NotifyOfDeath_Prefix(NoisemakerRole __instance) { - if (__instance.Player == null || !__instance.Player.IsAlive()) + if (ExtendedPlayerInfo.HasNoisemakerNotify.Contains(__instance.Player)) { return false; } + ExtendedPlayerInfo.HasNoisemakerNotify.Add(__instance.Player); + return true; } }