From 6e5e89a6043d87d8d4ee2a5b985b4703bec4fd53 Mon Sep 17 00:00:00 2001 From: CWX Date: Tue, 17 Jan 2023 19:55:03 +0000 Subject: [PATCH] attempt two --- Live/CWX_DebuggingTool/BotmonClass.cs | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/Live/CWX_DebuggingTool/BotmonClass.cs b/Live/CWX_DebuggingTool/BotmonClass.cs index 81646b8..4e5bf9e 100644 --- a/Live/CWX_DebuggingTool/BotmonClass.cs +++ b/Live/CWX_DebuggingTool/BotmonClass.cs @@ -89,11 +89,6 @@ namespace CWX_DebuggingTool if (_gameWorld == null) return; - foreach (var z in _zoneAndPlayers) - { - z.Value.Clear(); - } - if (_gameWorld.AllPlayers.Count > 1) { foreach (var player in _gameWorld.AllPlayers) @@ -109,17 +104,6 @@ namespace CWX_DebuggingTool } } } - - foreach (var pair in _zoneAndPlayers) - { - foreach (var person in pair.Value) - { - if (!person.HealthController.IsAlive) - { - pair.Value.Remove(person); - } - } - } } public void OnGUI() @@ -160,6 +144,11 @@ namespace CWX_DebuggingTool foreach (var player in _zoneAndPlayers[zone.Key]) { + if (!player.HealthController.IsAlive) + { + return; + } + total++; var distance = Vector3.Distance(player.Position, _player.Position); _stringBuilder.AppendLine($"> [{distance:n2}m] [{player.Profile.Info.Settings.Role}] [{player.Profile.Side}] {player.Profile.Nickname}");