X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fbase_rules.js;h=15609eb16dd29e2bfcbaa263c9df93b19c9c5a87;hb=cd0d7743323309fcfd241ccba959df81a77970c7;hp=eefd04d91c2d90f3656410d481ad8453a67b33e5;hpb=37cdcbf303d3c2e57b388a1abc9f853ba68a55cd;p=vchess.git diff --git a/client/src/base_rules.js b/client/src/base_rules.js index eefd04d9..15609eb1 100644 --- a/client/src/base_rules.js +++ b/client/src/base_rules.js @@ -50,13 +50,13 @@ export const ChessRules = class ChessRules // Turn "wb" into "B" (for FEN) static board2fen(b) { - return b[0]=='w' ? b[1].toUpperCase() : b[1]; + return (b[0]=='w' ? b[1].toUpperCase() : b[1]); } // Turn "p" into "bp" (for board) static fen2board(f) { - return f.charCodeAt()<=90 ? "w"+f.toLowerCase() : "b"+f; + return (f.charCodeAt()<=90 ? "w"+f.toLowerCase() : "b"+f); } // Check if FEN describe a position @@ -1062,8 +1062,6 @@ export const ChessRules = class ChessRules move.flags = JSON.stringify(this.aggregateFlags()); //save flags (for undo) if (V.HasEnpassant) this.epSquares.push( this.getEpSquare(move) ); - if (!move.color) - move.color = this.turn; //for interface V.PlayOnBoard(this.board, move); this.turn = V.GetOppCol(this.turn); this.movesCount++;