fix NoisemakerNotify

This commit is contained in:
D1GQ committed 2024-08-03 19:31:52 -05:00
1 parent a3d836fdb8
commit fc8261dee9
3 files changed
+9 -1

No files matched your search

+5
View File
@@ -33,6 +33,11 @@ class AntiCheat
{ {
ExtendedPlayerInfo.TimesCalledMeeting.Clear(); ExtendedPlayerInfo.TimesCalledMeeting.Clear();
} }
if (ExtendedPlayerInfo.HasNoisemakerNotify.Any())
{
ExtendedPlayerInfo.HasNoisemakerNotify.Clear();
}
} }
if (GameStates.IsHost && GameStates.IsInGame) if (GameStates.IsHost && GameStates.IsInGame)
+1
View File
@@ -3,6 +3,7 @@ namespace BetterAmongUs;
static class ExtendedPlayerInfo static class ExtendedPlayerInfo
{ {
public static List<PlayerControl> HasNoisemakerNotify = [];
public static Dictionary<PlayerControl, float> TimeSinceKill = []; public static Dictionary<PlayerControl, float> TimeSinceKill = [];
public static Dictionary<PlayerControl, int> TimesCalledMeeting = []; public static Dictionary<PlayerControl, int> TimesCalledMeeting = [];
private static Dictionary<PlayerControl, bool> IsBetterUser = new Dictionary<PlayerControl, bool>(); private static Dictionary<PlayerControl, bool> IsBetterUser = new Dictionary<PlayerControl, bool>();
+3 -1
View File
@@ -11,11 +11,13 @@ class RolePatch
[HarmonyPrefix] [HarmonyPrefix]
public static bool NotifyOfDeath_Prefix(NoisemakerRole __instance) public static bool NotifyOfDeath_Prefix(NoisemakerRole __instance)
{ {
if (__instance.Player == null || !__instance.Player.IsAlive()) if (ExtendedPlayerInfo.HasNoisemakerNotify.Contains(__instance.Player))
{ {
return false; return false;
} }
ExtendedPlayerInfo.HasNoisemakerNotify.Add(__instance.Player);
return true; return true;
} }
} }