From: Benjamin Auder Date: Sun, 6 Dec 2020 10:37:07 +0000 (+0100) Subject: Fix Fullcavalry initial setup X-Git-Url: https://git.auder.net/variants/current/doc/css/pieces/config.php?a=commitdiff_plain;h=de0706e6db65fa857a314a8d982f006d35eebb94;p=vchess.git Fix Fullcavalry initial setup --- diff --git a/client/src/variants/Fullcavalry.js b/client/src/variants/Fullcavalry.js index 7397261e..98549db4 100644 --- a/client/src/variants/Fullcavalry.js +++ b/client/src/variants/Fullcavalry.js @@ -104,10 +104,12 @@ export class FullcavalryRules extends ChessRules { (firstBlackRook <= 3 ? 'e' : 'm') + baseFen.substring(firstBlackRook + 1, lastBlackRook) + (lastBlackRook >= 5 ? 'm' : 'e') + + // Subtract 35 = total number of characters before last FEN row: + // 8x3 (full rows) + 4 (empty rows) + 7 (separators) baseFen.substring(lastBlackRook + 1, firstWhiteRook) + - (firstWhiteRook <= 3 ? 'E' : 'M') + + (firstWhiteRook - 35 <= 3 ? 'E' : 'M') + baseFen.substring(firstWhiteRook + 1, lastWhiteRook) + - (lastWhiteRook >= 5 ? 'M' : 'E') + + (lastWhiteRook - 35 >= 5 ? 'M' : 'E') + baseFen.substring(lastWhiteRook + 1) ); }