From 6cf124bfb6708c9decf653eae356718c2954b91e Mon Sep 17 00:00:00 2001 From: Gold KingZ <48490385+oqyh@users.noreply.github.com> Date: Wed, 13 Nov 2024 12:08:47 +0400 Subject: [PATCH] System.ArgumentException: Player with slot X not found (#667) --- .../Modules/Utils/RecipientFilter.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/managed/CounterStrikeSharp.API/Modules/Utils/RecipientFilter.cs b/managed/CounterStrikeSharp.API/Modules/Utils/RecipientFilter.cs index 970401690..24573b011 100644 --- a/managed/CounterStrikeSharp.API/Modules/Utils/RecipientFilter.cs +++ b/managed/CounterStrikeSharp.API/Modules/Utils/RecipientFilter.cs @@ -101,13 +101,11 @@ public CCSPlayerController this[int index] public void Add(int slot) { var player = Utilities.GetPlayerFromSlot(slot); - if (player == null) + if (player != null) { - throw new ArgumentException($"Player with slot {slot} not found"); + _recipients.Add(player); + CollectionChanged?.Invoke(); } - - _recipients.Add(player); - CollectionChanged?.Invoke(); } public void AddAllPlayers()