From ff44659a70eb20e38d561a0f0e596bf83590f07c Mon Sep 17 00:00:00 2001 From: D1GQ Date: Mon, 24 Mar 2025 03:48:12 -0500 Subject: [PATCH] Fix chat messages --- Patches/ChatPatch.cs | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/Patches/ChatPatch.cs b/Patches/ChatPatch.cs index d191ddf..699735a 100644 --- a/Patches/ChatPatch.cs +++ b/Patches/ChatPatch.cs @@ -1,12 +1,9 @@ using AmongUs.GameOptions; -using Assets.CoreScripts; using BetterAmongUs.Helpers; using BetterAmongUs.Modules; using BetterAmongUs.Modules.AntiCheat; using HarmonyLib; -using Hazel; using System.Text; -using System.Text.RegularExpressions; using TMPro; using UnityEngine; @@ -24,39 +21,6 @@ class ChatPatch HudManager.Instance.Chat.chatBubblePool.ReclaimAll(); } - [HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.RpcSendChat))] - class RpcSendChatPatch - { - internal static bool Prefix(PlayerControl __instance, string chatText, ref bool __result) - { - if (string.IsNullOrWhiteSpace(chatText)) - { - __result = false; - return false; - } - if (!GameState.IsBetterHostLobby) - { - __result = false; - return true; - } - chatText = Regex.Replace(chatText, "<.*?>", string.Empty); - if (AmongUsClient.Instance.AmClient && DestroyableSingleton.Instance) - { - DestroyableSingleton.Instance.Chat.AddChat(__instance, chatText, true); - } - if (chatText.IndexOf("who", StringComparison.OrdinalIgnoreCase) >= 0) - { - DestroyableSingleton.Instance.SendWho(); - } - chatText = "\n" + chatText; - MessageWriter messageWriter = AmongUsClient.Instance.StartRpc(__instance.NetId, 13, SendOption.Reliable); - messageWriter.Write(chatText); - messageWriter.EndMessage(); - __result = true; - return false; - } - } - [HarmonyPatch(typeof(ChatController))] internal class ChatControllerPatch {