fix : getIsPieceSacrifice

This commit is contained in:
GuillaumeSD
2024-04-18 16:23:33 +02:00
parent a565e643b9
commit 1305dde384

View File

@@ -185,11 +185,7 @@ export const getIsPieceSacrifice = (
playedMove: string,
bestLinePvToPlay: string[]
): boolean => {
if (
!bestLinePvToPlay.length ||
bestLinePvToPlay[0].slice(2, 4) !== playedMove.slice(2, 4)
)
return false;
if (!bestLinePvToPlay.length) return false;
const game = new Chess(fen);
const whiteToPlay = game.turn() === "w";