Fix placement chess in large-board version
authorFabian Fichter <ianfab@users.noreply.github.com>
Wed, 20 Feb 2019 21:50:33 +0000 (22:50 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Wed, 20 Feb 2019 21:50:33 +0000 (22:50 +0100)
src/position.cpp

index 6f88c07..f41bf8f 100644 (file)
@@ -767,7 +767,7 @@ bool Position::legal(Move m) const {
   {
       if (type_of(moved_piece(m)) != BISHOP)
       {
-          Bitboard remaining = drop_region(us) & ~pieces() & ~SquareBB[to];
+          Bitboard remaining = drop_region(us) & ~pieces() & ~SquareBB[to] & board_bb();
           // Are enough squares available to drop bishops on opposite colors?
           if (  (!( DarkSquares & pieces(us, BISHOP)) && ( DarkSquares & remaining))
               + (!(~DarkSquares & pieces(us, BISHOP)) && (~DarkSquares & remaining)) < count_in_hand(us, BISHOP))