From: Steinar H. Gunderson Date: Thu, 5 Sep 2019 19:26:52 +0000 (+0200) Subject: Fix another Chess960 Chess.js issue. X-Git-Url: https://git.sesse.net/?p=remoteglot;a=commitdiff_plain;h=ce321586248ffa259f27a4b4554d40c117250675 Fix another Chess960 Chess.js issue. --- diff --git a/www/js/chess.js b/www/js/chess.js index a0e3813..f02f04e 100644 --- a/www/js/chess.js +++ b/www/js/chess.js @@ -270,7 +270,7 @@ var Chess = function(fen) { var black_frc_columns = tokens[2].match(/[a-h]/g); if (black_frc_columns !== null) { for (i = 0; i < black_frc_columns.length; ++i) { - var sq = SQUARES.a1 + (black_frc_columns[0].charCodeAt(0) - "A".charCodeAt(0)); + var sq = SQUARES.a8 + (black_frc_columns[0].charCodeAt(0) - "a".charCodeAt(0)); flag = sq < kings[BLACK] ? BITS.QSIDE_CASTLE : BITS.KSIDE_CASTLE; castling.b |= flag; rooks[BLACK].push({square: sq, flag: flag});