fix : getIsPieceSacrifice
This commit is contained in:
@@ -185,11 +185,7 @@ export const getIsPieceSacrifice = (
|
|||||||
playedMove: string,
|
playedMove: string,
|
||||||
bestLinePvToPlay: string[]
|
bestLinePvToPlay: string[]
|
||||||
): boolean => {
|
): boolean => {
|
||||||
if (
|
if (!bestLinePvToPlay.length) return false;
|
||||||
!bestLinePvToPlay.length ||
|
|
||||||
bestLinePvToPlay[0].slice(2, 4) !== playedMove.slice(2, 4)
|
|
||||||
)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
const game = new Chess(fen);
|
const game = new Chess(fen);
|
||||||
const whiteToPlay = game.turn() === "w";
|
const whiteToPlay = game.turn() === "w";
|
||||||
|
|||||||
Reference in New Issue
Block a user