From 1bc0950accd1e4b0c9bb156ff877419cb300f9f6 Mon Sep 17 00:00:00 2001 From: XtraCube <72575280+XtraCube@users.noreply.github.com> Date: Sat, 14 Sep 2024 23:22:19 -0400 Subject: [PATCH] adjust code --- MiraAPI/Patches/HudManagerPatches.cs | 2 +- MiraAPI/Patches/Roles/HudManagerPatches.cs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/MiraAPI/Patches/HudManagerPatches.cs b/MiraAPI/Patches/HudManagerPatches.cs index 7e141f2..af7057d 100644 --- a/MiraAPI/Patches/HudManagerPatches.cs +++ b/MiraAPI/Patches/HudManagerPatches.cs @@ -90,7 +90,7 @@ public static class HudManagerPatches public static void SetHudActivePostfix(HudManager __instance, PlayerControl localPlayer, RoleBehaviour role, bool isActive) { __instance.AdminButton.ToggleVisible(isActive && role.IsImpostor && GameOptionsManager.Instance.CurrentGameOptions.GameMode == AmongUs.GameOptions.GameModes.HideNSeek); - if (!localPlayer.Data) + if (localPlayer.Data == null) { return; } diff --git a/MiraAPI/Patches/Roles/HudManagerPatches.cs b/MiraAPI/Patches/Roles/HudManagerPatches.cs index afe857f..a10afe3 100644 --- a/MiraAPI/Patches/Roles/HudManagerPatches.cs +++ b/MiraAPI/Patches/Roles/HudManagerPatches.cs @@ -17,6 +17,10 @@ public static class HudManagerPatches /// /// Fixes Kill Button not showing for Neutral killing role. /// + /// HudManager instance. + /// The local PlayerControl. + /// The player's RoleBehaviour. + /// Whether the Hud should be set active or not. [HarmonyPostfix] [HarmonyPatch(nameof(HudManager.SetHudActive), typeof(PlayerControl), typeof(RoleBehaviour), typeof(bool))] public static void SetHudActivePostfix(