From bfdeb4d2576def82aea9d5632dba2805f1098b44 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Thu, 8 Aug 2024 23:42:55 -0500 Subject: [PATCH] Enable kick and ban in gameplay --- Patches/ClientPatch.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Patches/ClientPatch.cs b/Patches/ClientPatch.cs index c8c08c7..f1b4d9e 100644 --- a/Patches/ClientPatch.cs +++ b/Patches/ClientPatch.cs @@ -17,6 +17,24 @@ public class ClientPatch Logger.Log($"Client has left game for: {Enum.GetName(reason)}", "AmongUsClientPatch"); } } + [HarmonyPatch(typeof(InnerNetClient))] + public class InnerNetClientPatch + { + [HarmonyPatch(nameof(InnerNetClient.CanBan))] + [HarmonyPrefix] + public static bool CanBan_Prefix(ref bool __result) + { + __result = GameStates.IsHost; + return false; + } + [HarmonyPatch(nameof(InnerNetClient.CanKick))] + [HarmonyPrefix] + public static bool CanKick_Prefix(ref bool __result) + { + __result = GameStates.IsHost; + return false; + } + } // Set text color [HarmonyPatch(typeof(CosmeticsLayer))] public class CosmeticsLayerPatch