From 17cc3d8d61d6d3aa9fdf043647741dae6a79fd5e Mon Sep 17 00:00:00 2001 From: Benjamin Auder Date: Mon, 10 May 2021 20:17:22 +0200 Subject: [PATCH] Attempt to fix 8-pieces random symmetric mode --- client/src/variants/Eightpieces.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/variants/Eightpieces.js b/client/src/variants/Eightpieces.js index eaf7d33e..ded87579 100644 --- a/client/src/variants/Eightpieces.js +++ b/client/src/variants/Eightpieces.js @@ -183,8 +183,10 @@ export class EightpiecesRules extends ChessRules { // or (eventually) the index of replacement: let newPos = { 0: "", 7: "" }; let sentryOddity = -1; + let replaced = {}; + if (options.randomness == 1) replaced = { 'b': -2, 'n': -2, 'r': -2 }; for (let rank of [0, 7]) { - let replaced = { 'b': -2, 'n': -2, 'r': -2 }; + if (options.randomness == 2) replaced = { 'b': -2, 'n': -2, 'r': -2 }; for (let i = 0; i < 8; i++) { const curChar = posParts[rank].charAt(i).toLowerCase(); if (['b', 'n', 'r'].includes(curChar)) { -- 2.44.0