From 5ae6d648e3840250377fe7ff12ebc52817cb17d6 Mon Sep 17 00:00:00 2001 From: Ape <155788660+ApeMV@users.noreply.github.com> Date: Fri, 23 Jan 2026 17:39:24 +0100 Subject: [PATCH] ??????????????????????? --- Patches/ChatPatches.cs | 8 +++----- Patches/GameStartManagerPatch.cs | 5 ++--- Patches/PlayerControlPatches.cs | 4 ++-- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Patches/ChatPatches.cs b/Patches/ChatPatches.cs index 97cdfd8..cac736c 100644 --- a/Patches/ChatPatches.cs +++ b/Patches/ChatPatches.cs @@ -14,9 +14,8 @@ internal static class ChatControllerUpdatePatch public static void Postfix(ChatController __instance) { - if (__instance == null || __instance.freeChatField == null || __instance.freeChatField.textArea == null || __instance.freeChatField.background == null || __instance.freeChatField.textArea.compoText == null || __instance.freeChatField.textArea.outputText == null) return; - - if (__instance.quickChatField == null || __instance.quickChatField.background == null || __instance.quickChatField.text == null) return; + if (!__instance||!__instance.freeChatField||!__instance.freeChatField.textArea||!__instance.freeChatField.background||__instance.freeChatField.textArea.compoText == null||!__instance.freeChatField.textArea.outputText) return; + if (!__instance.quickChatField||!__instance.quickChatField.background||__instance.quickChatField.text==null) return; if (Main.DarkTheme.Value) { @@ -44,9 +43,8 @@ internal static class ChatBubbleSetNamePatch { public static void Postfix(ChatBubble __instance, [HarmonyArgument(2)] bool voted) { - if (__instance == null || __instance.playerInfo == null || __instance.playerInfo.Object == null || __instance.playerInfo?.Object?.Data == null || __instance.TextArea == null) return; + if (!__instance||!__instance.playerInfo||!__instance.playerInfo.Object||!__instance.playerInfo.Object.Data||!__instance.TextArea||!__instance.Background) return; - PlayerControl seer = PlayerControl.LocalPlayer; PlayerControl target = __instance.playerInfo.Object; if (Main.DarkTheme.Value) diff --git a/Patches/GameStartManagerPatch.cs b/Patches/GameStartManagerPatch.cs index f4c42f4..7751bf1 100644 --- a/Patches/GameStartManagerPatch.cs +++ b/Patches/GameStartManagerPatch.cs @@ -12,10 +12,9 @@ public static class GameStartManagerUpdatePatch public static void Prefix(GameStartManager __instance) { - if (__instance == null) return; + if (__instance == null || MeetingHud.Instance != null) return; if (AmongUsClient.Instance == null || !AmongUsClient.Instance.AmHost) return; - // Only run our custom logic when safe if (__instance.StartButton == null || __instance.GameStartText == null) return; __instance.MinPlayers = 1; @@ -49,7 +48,7 @@ public static class GameStartManagerUpdatePatch { string warningMessage = ""; - if (!AmongUsClient.Instance.AmHost) return; + if (!AmongUsClient.Instance.AmHost || __instance.GameStartText == null) return; if (GameStartManagerStartPatch.warningText != null) { diff --git a/Patches/PlayerControlPatches.cs b/Patches/PlayerControlPatches.cs index fe82b21..29e1e2d 100644 --- a/Patches/PlayerControlPatches.cs +++ b/Patches/PlayerControlPatches.cs @@ -12,9 +12,9 @@ class ReportDeadBodyPatch { public static bool Prefix(PlayerControl __instance, [HarmonyArgument(0)] NetworkedPlayerInfo target) { - if (!AmongUsClient.Instance.AmHost) return true; + if (!AmongUsClient.Instance.AmHost || target == null || __instance == null) return true; - if (Options.DisableReport.GetBool() && target != null || Options.Gamemode.GetValue() == 2 || Options.Gamemode.GetValue() == 3) + if (Options.DisableReport.GetBool() || Options.Gamemode.GetValue() == 2 || Options.Gamemode.GetValue() == 3) { Logger.Info($" Stopped {__instance.Data.PlayerName} reporting the body of {target.PlayerName}", "ReportDeadBodyPatch"); return false;