Skip to content

Commit

Permalink
Fix infinite loop by chnaging to getPseudoLegalCoords
Browse files Browse the repository at this point in the history
  • Loading branch information
TongZhengHong committed Nov 9, 2023
1 parent e0c3716 commit 201303c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/chessmaster/game/ChessBoard.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public Move[] getPseudoLegalMoves(Color color) {
ChessPiece piece = getPieceAtCoor(currentCoor);

if (piece.isSameColorAs(color)) {
Coordinate[] possibleCoordinates = piece.getLegalCoordinates(this);
Coordinate[] possibleCoordinates = piece.getPseudoLegalCoordinates(this);
for (Coordinate possible: possibleCoordinates) {
allMoves.add(MoveFactory.createMove(this, currentCoor, possible));
}
Expand Down

0 comments on commit 201303c

Please sign in to comment.