adjust code

This commit is contained in:
XtraCube committed 2024-09-14 23:22:19 -04:00
1 parent 3aecd5a91c
commit 1bc0950acc
2 files changed
+5 -1

No files matched your search

+1 -1
View File
@@ -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;
}
@@ -17,6 +17,10 @@ public static class HudManagerPatches
/// <summary>
/// Fixes Kill Button not showing for Neutral killing role.
/// </summary>
/// <param name="__instance">HudManager instance.</param>
/// <param name="localPlayer">The local PlayerControl.</param>
/// <param name="role">The player's RoleBehaviour.</param>
/// <param name="isActive">Whether the Hud should be set active or not.</param>
[HarmonyPostfix]
[HarmonyPatch(nameof(HudManager.SetHudActive), typeof(PlayerControl), typeof(RoleBehaviour), typeof(bool))]
public static void SetHudActivePostfix(