From 744fa3c4e6066b94e3015130ae97aecbc901c828 Mon Sep 17 00:00:00 2001 From: Ian Harris Date: Sat, 22 Jul 2023 09:54:47 -0700 Subject: [PATCH] Fixes #172 I'm not sure if this is an actual fix, but it's difficult to recreate. This allows for multiple writers and readers, so there may be some instances where the highlighted cells are incorrect, but I'm not sure how that would happen. This also should only happen when rapidly visualizing bots, so shouldn't ever be noticeable anyway. --- Chess-Challenge/src/Framework/Application/UI/BoardUI.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Chess-Challenge/src/Framework/Application/UI/BoardUI.cs b/Chess-Challenge/src/Framework/Application/UI/BoardUI.cs index c68bd5f65..cb8c49060 100644 --- a/Chess-Challenge/src/Framework/Application/UI/BoardUI.cs +++ b/Chess-Challenge/src/Framework/Application/UI/BoardUI.cs @@ -162,14 +162,7 @@ public void OverrideSquareColour(int square, HighlightType hightlightType) _ => Color.PINK }; - if (squareColOverrides.ContainsKey(square)) - { - squareColOverrides[square] = col; - } - else - { - squareColOverrides.Add(square, col); - } + squareColOverrides[square] = col; } public void HighlightLegalMoves(Board board, int square)