From c06e2414acf50379a7b80f7c4a7e25425de4ce9a Mon Sep 17 00:00:00 2001 From: D1GQ Date: Sat, 30 May 2026 14:11:26 -0500 Subject: [PATCH] clean up --- src/Helpers/PlayerControlHelper.cs | 4 +++- src/Patches/Gameplay/Player/PlayerJoinAndLeftPatch.cs | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Helpers/PlayerControlHelper.cs b/src/Helpers/PlayerControlHelper.cs index 960bdf8..c2d23f3 100644 --- a/src/Helpers/PlayerControlHelper.cs +++ b/src/Helpers/PlayerControlHelper.cs @@ -40,7 +40,9 @@ internal static class PlayerControlHelper var snapshot = AmongUsClient.Instance.allClients.ToArray(); foreach (var client in snapshot) { - if (client?.Character == null) continue; + if (client == null) continue; + if (client.Character == null) continue; + if (client.Character.PlayerId == player.PlayerId) return client; } diff --git a/src/Patches/Gameplay/Player/PlayerJoinAndLeftPatch.cs b/src/Patches/Gameplay/Player/PlayerJoinAndLeftPatch.cs index 67b954d..1da13cd 100644 --- a/src/Patches/Gameplay/Player/PlayerJoinAndLeftPatch.cs +++ b/src/Patches/Gameplay/Player/PlayerJoinAndLeftPatch.cs @@ -123,6 +123,9 @@ internal static class PlayerJoinAndLeftPatch internal static void BetterShowNotification(NetworkedPlayerInfo playerData, DisconnectReasons reason = DisconnectReasons.Unknown, string forceReasonText = "") { + if (playerData == null) + return; + // Prevent showing duplicate notifications if (playerData.ExtendedData().AntiCheatInfo.BannedByAntiCheat || playerData.ExtendedData().HasShowDcMsg) return;