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
);
});
this.repetitions.push(
{
piece: move.end.released,
+ square: { x: move.end.x, y: move.end.y },
position: this.getBaseFen()
}
);
this.turn = V.GetOppCol(this.turn);
this.movesCount--;
}
- if (!!move.end.releasd) this.repetitions.pop();
+ if (!!move.end.released) this.repetitions.pop();
this.postUndo(move);
}