X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FChakart.js;h=5f20132ea48fe68294224e08c3349ecaa1ba3c8b;hb=b2e8c34e0158f512741d67b8a1c25425e0b8747e;hp=e5473d7ced3442486ac33c4cc0e6c9f00e6c95ed;hpb=a1075a5191864994901e559b8b849279f6372211;p=vchess.git diff --git a/client/src/variants/Chakart.js b/client/src/variants/Chakart.js index e5473d7c..5f20132e 100644 --- a/client/src/variants/Chakart.js +++ b/client/src/variants/Chakart.js @@ -30,7 +30,7 @@ export class ChakartRules extends ChessRules { return true; } - hoverHighlight(x, y) { + hoverHighlight([x, y]) { if (this.subTurn == 1) return false; const L = this.firstMove.length; const fm = this.firstMove[L-1]; @@ -1422,7 +1422,7 @@ export class ChakartRules extends ChessRules { let notation = undefined; if (piece == V.PAWN) { // Pawn move - if (move.vanish.length >= 2) { + if (this.board[move.end.x][move.end.y] != V.EMPTY) { // Capture const startColumn = V.CoordToColumn(move.start.y); notation = startColumn + "x" + finalSquare; @@ -1435,7 +1435,7 @@ export class ChakartRules extends ChessRules { else { notation = piece.toUpperCase() + - (move.vanish.length >= 2 ? "x" : "") + + (this.board[move.end.x][move.end.y] != V.EMPTY ? "x" : "") + finalSquare; } if (!!move.end.effect) {