fix : analysis fails on getIsPieceSacrifice throw
This commit is contained in:
@@ -202,13 +202,18 @@ export const getIsPieceSacrifice = (
|
|||||||
b: [],
|
b: [],
|
||||||
};
|
};
|
||||||
for (const move of moves) {
|
for (const move of moves) {
|
||||||
const fullMove = game.move(uciMoveParams(move));
|
try {
|
||||||
if (fullMove.captured) {
|
const fullMove = game.move(uciMoveParams(move));
|
||||||
capturedPieces[fullMove.color].push(fullMove.captured);
|
if (fullMove.captured) {
|
||||||
nonCapturingMovesTemp = 1;
|
capturedPieces[fullMove.color].push(fullMove.captured);
|
||||||
} else {
|
nonCapturingMovesTemp = 1;
|
||||||
nonCapturingMovesTemp--;
|
} else {
|
||||||
if (nonCapturingMovesTemp < 0) break;
|
nonCapturingMovesTemp--;
|
||||||
|
if (nonCapturingMovesTemp < 0) break;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user