X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FEightpieces.js;fp=client%2Fsrc%2Fvariants%2FEightpieces.js;h=ded8757980f94871cd94adef9b90e4741c089105;hp=eaf7d33e3c03de96dc617574304c9e99bcee6478;hb=17cc3d8d61d6d3aa9fdf043647741dae6a79fd5e;hpb=9804f90b3caec5ffe0fec6631f1459b24d6d04b1 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)) {