fix : analysis fails on getIsPieceSacrifice throw

This commit is contained in:
GuillaumeSD
2024-07-20 16:38:46 +02:00
parent 05473c8a85
commit b84286c011

View File

@@ -202,6 +202,7 @@ export const getIsPieceSacrifice = (
b: [],
};
for (const move of moves) {
try {
const fullMove = game.move(uciMoveParams(move));
if (fullMove.captured) {
capturedPieces[fullMove.color].push(fullMove.captured);
@@ -210,6 +211,10 @@ export const getIsPieceSacrifice = (
nonCapturingMovesTemp--;
if (nonCapturingMovesTemp < 0) break;
}
} catch (e) {
console.error(e);
return false;
}
}
for (const p of capturedPieces["w"].slice(0)) {