X-Git-Url: https://git.auder.net/assets/current/gitweb.css?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FOtage.js;h=742c6ee19e02c0cf6217be9fa9ac48e17da2bb55;hb=d2af3400944331ffd0c770f83857257c2f48e487;hp=6f408bb134c507d6a4dd19a1bdfb96a250ebce1c;hpb=34b79fe4fa5aecdfa64742e7ff98a1befffa34ed;p=vchess.git diff --git a/client/src/variants/Otage.js b/client/src/variants/Otage.js index 6f408bb1..742c6ee1 100644 --- a/client/src/variants/Otage.js +++ b/client/src/variants/Otage.js @@ -646,11 +646,19 @@ export class OtageRules extends ChessRules { if (!m.end.released) return true; // Check for repetitions: V.PlayOnBoard(this.board, m); - const newState = { piece: m.end.released, position: this.getBaseFen() }; + const newState = { + piece: m.end.released, + square: { x: m.end.x, y: m.end.y }, + position: this.getBaseFen() + }; const repet = this.repetitions.some(r => { return ( r.piece == newState.piece && + ( + r.square.x == newState.square.x && + r.square.y == newState.square.y && + ) && r.position == newState.position ); }); @@ -724,6 +732,7 @@ export class OtageRules extends ChessRules { this.repetitions.push( { piece: move.end.released, + square: { x: move.end.x, y: move.end.y }, position: this.getBaseFen() } );