rewrote the whole GetDirection function + minor bugfix in castling updates
This commit is contained in:
1 parent
4226b21043
commit
ff0c0c785a
3 files changed
+25
-18
No files matched your search
+1
-1
@@ -295,7 +295,7 @@ void Board::RemovePiece(int piece, int square, bool color) {
|
||||
static void UpdateCastlingRights(Board &board, int targetPiece, int targetSquare, int attackerColor) {
|
||||
if (targetPiece == Rook) {
|
||||
int queenSideRook = attackerColor ? a1 : a8;
|
||||
int kingSideRook = attackerColor ? a8 : h8;
|
||||
int kingSideRook = attackerColor ? h1 : h8;
|
||||
|
||||
if (targetSquare == queenSideRook) {
|
||||
board.castlingRights[!attackerColor * 2 + 1] = false;
|
||||
|
||||
Reference in new issue
Block a user