From 459207c5772a81a5b4f0335f9c24a1b54862da91 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Sat, 3 Aug 2024 22:07:44 -0500 Subject: [PATCH] use player.IsImpostorTeam() --- Modules/AntiCheat.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Modules/AntiCheat.cs b/Modules/AntiCheat.cs index 1628432..9aecb9f 100644 --- a/Modules/AntiCheat.cs +++ b/Modules/AntiCheat.cs @@ -206,8 +206,6 @@ class AntiCheat RoleTypes? Role = player?.Data?.RoleType; Role ??= RoleTypes.Crewmate; - bool IsImpostor = player.IsImpostorTeam(); - bool IsCrewmate = !player.IsImpostorTeam(); string hashPuid = Utils.GetHashPuid(player); if (callId is (byte)RpcCalls.SendChat or (byte)RpcCalls.SendQuickChat) @@ -220,7 +218,7 @@ class AntiCheat if (callId is (byte)RpcCalls.EnterVent or (byte)RpcCalls.ExitVent) { - if ((IsCrewmate && Role != RoleTypes.Engineer) || player.Data.IsDead) + if ((!player.IsImpostorTeam() && Role != RoleTypes.Engineer) || player.Data.IsDead) BetterNotificationManager.NotifyCheat(player, $"Invalid Action RPC: {Enum.GetName((RpcCalls)callId)}"); return; @@ -242,7 +240,7 @@ class AntiCheat if (target != null) { - if (IsCrewmate || !player.IsAlive() || player.IsInVanish() || !target.IsAlive() || target.IsImpostorTeam() + if (!player.IsImpostorTeam() || !player.IsAlive() || player.IsInVanish() || !target.IsAlive() || target.IsImpostorTeam() || ExtendedPlayerInfo.TimeSinceKill.TryGetValue(player, out var value) && value < (float)GameOptionsManager.Instance.currentNormalGameOptions.KillCooldown) { BetterNotificationManager.NotifyCheat(player, $"Invalid Action RPC: {Enum.GetName((RpcCalls)callId)}"); @@ -267,7 +265,7 @@ class AntiCheat return; } - if (IsCrewmate) + if (!player.IsImpostorTeam()) { if (GameStates.IsInGamePlay) { @@ -296,7 +294,7 @@ class AntiCheat } } - if (IsImpostor) + if (player.IsImpostorTeam()) { if (callId is (byte)RpcCalls.CompleteTask or (byte)RpcCalls.BootFromVent) {