]> git.sesse.net Git - stockfish/commit
Checking for rook color when setting castling
authorMarco Costalba <mcostalba@gmail.com>
Fri, 29 May 2015 03:38:40 +0000 (05:38 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Fri, 29 May 2015 03:38:40 +0000 (05:38 +0200)
commit2795aedbc3710287448bad058c6077920066ad30
tree593c08921e949ce1750d56d8a0487077870ea165
parent8e95c39bfa97e6248d9686b47dc4361f23fda06f
Checking for rook color when setting castling

In Chess960 we can have legal positions with
opponent rook in A or H file and with castling
available, for instance:

4k3/pppppppp/8/8/8/8/PPPPPPPP/rR2K3 w Q - 0 1

In those cases we pick up the wrong rook when
setting castling.

Fix it by checking the color of the rook.

Bug reported by Matthew Lai.

No functional change.
src/position.cpp