Fix Reversi style piece flips
authorFabian Fichter <ianfab@users.noreply.github.com>
Sun, 2 Jan 2022 12:08:30 +0000 (13:08 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sun, 2 Jan 2022 12:08:30 +0000 (13:08 +0100)
between_bb was redefined in an upstream merge,
which broke the implementation for Reversi/Othello.

src/position.cpp

index 2e79820..d1a1c1f 100644 (file)
@@ -1502,7 +1502,7 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {
       {
           Bitboard b = attacks_bb(us, QUEEN, to, board_bb() & ~pieces(~us)) & ~PseudoAttacks[us][KING][to] & pieces(us);
           while(b)
-              st->flippedPieces |= between_bb(to, pop_lsb(b));
+              st->flippedPieces |= between_bb(pop_lsb(b), to) ^ to;
       }
       else
       {