IPVGO: Fix self-capture move evaluation (#1140)

This commit is contained in:
Michael Ficocelli
2024-03-06 16:23:16 -05:00
committed by GitHub
parent 1755b7cd7f
commit 1547581c24
2 changed files with 17 additions and 4 deletions
+2 -2
View File
@@ -480,12 +480,12 @@ export function findAllCapturedChains(chainList: PointState[][], playerWhoMoved:
const opposingPlayer = playerWhoMoved === GoColor.white ? GoColor.black : GoColor.white;
const enemyChainsToCapture = findCapturedChainOfColor(chainList, opposingPlayer);
if (enemyChainsToCapture) {
if (enemyChainsToCapture.length) {
return enemyChainsToCapture;
}
const friendlyChainsToCapture = findCapturedChainOfColor(chainList, playerWhoMoved);
if (friendlyChainsToCapture) {
if (friendlyChainsToCapture.length) {
return friendlyChainsToCapture;
}
}