Make drop region constraint more explicit
authorFabian Fichter <ianfab@users.noreply.github.com>
Tue, 1 Oct 2019 20:07:06 +0000 (22:07 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Tue, 1 Oct 2019 20:07:06 +0000 (22:07 +0200)
No functional change.

src/position.cpp

index f6ef5db..ea2dfe6 100644 (file)
@@ -793,7 +793,7 @@ bool Position::legal(Move m) const {
   {
       if (type_of(moved_piece(m)) != BISHOP)
       {
-          Bitboard remaining = drop_region(us) & ~pieces() & ~SquareBB[to] & board_bb();
+          Bitboard remaining = drop_region(us, BISHOP) & ~pieces() & ~square_bb(to);
           // 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))