Drempel3387 / chessGame

1 stars 0 forks source link

King Can Castle Through Check #3

Closed Drempel3387 closed 1 year ago

Drempel3387 commented 1 year ago

https://github.com/Drempel3387/chessGame/blob/391a02b4500be4b47dd71307ade7ea1f48481f73/src/chess/engine/Pieces/King.java#L70C21-L70C46

The actual square of the king is not updated to see if the king would be placed into check while attempting to castle. The isKingChecked call only sees if it's starting position would be a check, thus, the king can castle through check. Must be fixed

Drempel3387 commented 1 year ago

The kings position is now updated accordingly to see if any of the castling squares would place it into check.