X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FVchess.js;h=8b59c863d63b56ab27291279b4edf9dbfcc8a055;hp=4e84eb0e9115d3e80757029488fc13b6d1e1621c;hb=b2b5a72927ce977f96569b78126165b60f23f039;hpb=c01212801607b7f6336d6378ad64872a19bb4f15 diff --git a/client/src/variants/Vchess.js b/client/src/variants/Vchess.js index 4e84eb0e..8b59c863 100644 --- a/client/src/variants/Vchess.js +++ b/client/src/variants/Vchess.js @@ -11,7 +11,16 @@ export class VchessRules extends ChessRules { getNotation(move) { let notation = super.getNotation(move); - // TODO: if capture backwards, add an indication 'b' + // If pawn captures backward, add an indication 'b' + if ( + move.appear[0].p == V.PAWN && + ( + (move.appear[0].c == 'w' && (move.end.x - move.start.x > 0)) || + (move.appear[0].c == 'b' && (move.end.x - move.start.x < 0)) + ) + ) { + notation += 'b'; + } return notation; } };