diff --git a/Modules/ExtendedPlayerControl.cs b/Modules/ExtendedPlayerControl.cs index 315cdbc..3c5a761 100644 --- a/Modules/ExtendedPlayerControl.cs +++ b/Modules/ExtendedPlayerControl.cs @@ -151,6 +151,8 @@ static class ExtendedPlayerControl return "#8cffff"; } } + // Check if player is role type + public static bool Is(this PlayerControl player, RoleTypes role) => player?.Data?.RoleType == role; // Check if player is on imposter team public static bool IsImpostorTeam(this PlayerControl player) => player?.Data != null && (player.Data.RoleType is RoleTypes.Impostor or RoleTypes.ImpostorGhost or RoleTypes.Shapeshifter or RoleTypes.Phantom); // Check if player is a imposter teammate diff --git a/Modules/Zoom.cs b/Modules/Zoom.cs index e3bab1c..2827a41 100644 --- a/Modules/Zoom.cs +++ b/Modules/Zoom.cs @@ -1,4 +1,5 @@ -using HarmonyLib; +using AmongUs.GameOptions; +using HarmonyLib; using UnityEngine; namespace BetterAmongUs; @@ -11,8 +12,7 @@ public static class Zoom public static void Postfix() { - if ((GameStates.IsShip && !GameStates.IsMeeting && GameStates.IsCanMove && PlayerControl.LocalPlayer.Data.IsDead) || - (GameStates.IsLobby && GameStates.IsCanMove)) + if (GameStates.IsCanMove && !PlayerControl.LocalPlayer.Is(RoleTypes.GuardianAngel) && (!GameStates.IsInGamePlay || !PlayerControl.LocalPlayer.IsAlive())) { if (Camera.main.orthographicSize > 3.0f) resetButtons = true;