Fix "engine error" after delivering mate in ponder-on game.

When the human player delivers check mate in a ponder-on game, the GUI sometimes
reported "engine error". This happened when the computer was pondering a move
that ended the game, so that there were no valid moves after the ponder move.
This commit is contained in:
Peter Osterlund 2019-04-20 07:19:33 +02:00
parent e42ee6607e
commit d292f0604c

View File

@ -827,6 +827,11 @@ public class DroidComputerPlayer {
tmpPos.makeMove(bestM, ui);
if (!TextIO.isValid(tmpPos, nextPonderMove))
canPonder = false;
if (canPonder) {
tmpPos.makeMove(nextPonderMove, ui);
if (MoveGen.instance.legalMoves(tmpPos).isEmpty())
canPonder = false;
}
}
}
if (!canPonder)