X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FWildebeest.js;h=a49da9b2a239c050b153ccd39896087cec1aefd0;hb=a538d4b000f905da16206871bb8f11e7e93f0c6a;hp=a2fc614822932c6dfc625ac9290a62aa6cde6c2c;hpb=83cecc0fec143a6eac6f6632048d99398bd4c0da;p=vchess.git diff --git a/client/src/variants/Wildebeest.js b/client/src/variants/Wildebeest.js index a2fc6148..a49da9b2 100644 --- a/client/src/variants/Wildebeest.js +++ b/client/src/variants/Wildebeest.js @@ -83,7 +83,7 @@ export class WildebeestRules extends ChessRules { } ]; if (sx + 2 * step != ex) { - //3-squares move + // 3-squares move res.push({ x: sx + 2 * step, y: sy @@ -228,7 +228,12 @@ export class WildebeestRules extends ChessRules { for (let i = range[0]; i <= range[1]; i++) { if (i != rookPos && this.isAttacked([x, i], oppCol)) continue castlingCheck; - if (i != y) { + if ( + i != y && + // Do not end in the corner, except if starting square is too near + (i > 0 || y == 1) && + (i < V.size.y - 1 || y == V.size.y - 2) + ) { // Found a possible castle move: moves.push( new Move({ @@ -305,7 +310,6 @@ export class WildebeestRules extends ChessRules { } static GenRandInitFen(randomness) { - if (!randomness) randomness = 2; if (randomness == 0) { return ( "rnccwkqbbnr/ppppppppppp/92/92/92/92/92/92/PPPPPPPPPPP/RNBBQKWCCNR " +