From: Benjamin Auder <benjamin.auder@somewhere>
Date: Mon, 10 May 2021 18:17:22 +0000 (+0200)
Subject: Attempt to fix 8-pieces random symmetric mode
X-Git-Url: https://git.auder.net/variants/img/current/assets/css/pieces/%7B%7B?a=commitdiff_plain;h=17cc3d8d61d6d3aa9fdf043647741dae6a79fd5e;p=vchess.git

Attempt to fix 8-pieces random symmetric mode
---

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)) {