From f5722ecec4798fb46dc5c62ad4243139bcdd1032 Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Sun, 6 Jan 2019 13:13:30 +0100
Subject: [PATCH] Fix Dark enlightened array update

---
 public/javascripts/variants/Dark.js | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/public/javascripts/variants/Dark.js b/public/javascripts/variants/Dark.js
index f1bd6c0d..79d27b5b 100644
--- a/public/javascripts/variants/Dark.js
+++ b/public/javascripts/variants/Dark.js
@@ -16,14 +16,20 @@ class DarkRules extends ChessRules
 
 	updateEnlightened()
 	{
-		const pawnShift = {"w":-1, "b":1};
-		// Initialize with pieces positions (which are seen)
 		for (let i=0; i<V.size.x; i++)
 		{
 			for (let j=0; j<V.size.y; j++)
 			{
 				this.enlightened["w"][i][j] = false;
 				this.enlightened["b"][i][j] = false;
+			}
+		}
+		const pawnShift = {"w":-1, "b":1};
+		// Initialize with pieces positions (which are seen)
+		for (let i=0; i<V.size.x; i++)
+		{
+			for (let j=0; j<V.size.y; j++)
+			{
 				if (this.board[i][j] != V.EMPTY)
 				{
 					const color = this.getColor(i,j);
-- 
2.44.0