From 1305dde3849993b8805f4978af0b72a4d0f2dd3b Mon Sep 17 00:00:00 2001 From: GuillaumeSD Date: Thu, 18 Apr 2024 16:23:33 +0200 Subject: [PATCH] fix : getIsPieceSacrifice --- src/lib/chess.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/lib/chess.ts b/src/lib/chess.ts index 50fc3a7..efceff9 100644 --- a/src/lib/chess.ts +++ b/src/lib/chess.ts @@ -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";