From 2f31fd174c5d721c100dda69d4789e335ccb590f Mon Sep 17 00:00:00 2001 From: Mister_Nebula <41904486+misternebula@users.noreply.github.com> Date: Fri, 26 Aug 2022 00:19:49 +0100 Subject: [PATCH] optimize smh --- QSB/Player/QSBPlayerManager.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/QSB/Player/QSBPlayerManager.cs b/QSB/Player/QSBPlayerManager.cs index 6758c8c6..6ea62b67 100644 --- a/QSB/Player/QSBPlayerManager.cs +++ b/QSB/Player/QSBPlayerManager.cs @@ -137,8 +137,15 @@ public static class QSBPlayerManager { if (QSBCore.IsInMultiplayer && QSBCore.IsHost) { - foreach (var player in PlayerList.Where(x => !x.IsLocalPlayer).ToList()) + for (var i = 0; i < PlayerList.Count; i++) { + var player = PlayerList[i]; + + if (player.IsLocalPlayer) + { + continue; + } + // if we didn't receive a response in the last loop then we should remove them if (!player.HeartbeatReceived) {