Fix blocking checkmate
This commit is contained in:
parent
e178d88742
commit
5e1553aaf6
1 changed files with 0 additions and 3 deletions
|
@ -227,13 +227,10 @@ public class Board {
|
||||||
if (inCheck) {
|
if (inCheck) {
|
||||||
isGameOver = true;
|
isGameOver = true;
|
||||||
for (Move move : getAllLegalMoves(!movedPiece.black)) {
|
for (Move move : getAllLegalMoves(!movedPiece.black)) {
|
||||||
move(move);
|
|
||||||
if (!oppositeKing.isInCheck(move, this)) {
|
if (!oppositeKing.isInCheck(move, this)) {
|
||||||
isGameOver = false;
|
isGameOver = false;
|
||||||
undoMove();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
undoMove();
|
|
||||||
}
|
}
|
||||||
} else if (getAllLegalMoves(movedPiece.black).isEmpty()) {
|
} else if (getAllLegalMoves(movedPiece.black).isEmpty()) {
|
||||||
isGameOver = true;
|
isGameOver = true;
|
||||||
|
|
Reference in a new issue