Pawn double move bugfix
This commit is contained in:
parent
4c7bce01f8
commit
50ba504505
|
@ -34,7 +34,8 @@ public class Pawn extends AbstractPiece {
|
|||
boolean isPieceThere = chessboard.getPiece(new PiecePosition(x+i, y+directionY)) != null;
|
||||
if((i != 0 && (theoretical || isPieceThere)) || (i == 0 && (!theoretical && !isPieceThere))) setPossibleMove(moves, x+i, y+directionY);
|
||||
}
|
||||
if(moveCount == 0 && chessboard.getPiece(new PiecePosition(x, y+directionY*2)) == null) setPossibleMove(moves, x, y + directionY*2);
|
||||
boolean nextTwoPlacesEmpty = chessboard.getPiece(new PiecePosition(x, y+directionY*2)) == null && chessboard.getPiece(new PiecePosition(x, y+directionY)) == null;
|
||||
if(moveCount == 0 && nextTwoPlacesEmpty) setPossibleMove(moves, x, y + directionY*2);
|
||||
return moves;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue