Closed Starlight-30036225 closed 9 months ago
Kings are still ignoring eachother when checking for possible moves. This is a left over from some early code. Im not sure if removing it will cause new issues though
static boolean isLocationSafe(Piece[][] Board, Piece piece, int x, int y) { for (Piece[] col : Board) { for (Piece p : col) { //Iterates through all pieces if (p != null && piece.white != p.white && p.getClass() != King.class && p.GetPossibleMoves(Board).contains(x + "" + y)) { return false; } } } return true; }
This function ignores checks for possible moves if the piece is a king. This was to stop infinite loops. I dont think that will happen anymore, but there is only one way to find out...
That was easy...
Kings should never be able to touch. But they can...
That;s not good.