X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=cdbd9f0d1963ff13486c986c401e340e1c960d03;hp=591d48fbb41b3254bf8cef4c6a63edcebe91c94a;hb=d7ef09727acc11c91b4a25b775c7f6d0bf1d37d8;hpb=d3f99aea6b6a7653c2d60ac94e600b1b2f5800e1 diff --git a/src/position.cpp b/src/position.cpp index 591d48fb..cdbd9f0d 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -755,7 +755,7 @@ void Position::do_move(Move m, StateInfo& newSt, Bitboard dcCandidates) { st->capture = type_of_piece_on(to); if (st->capture) - do_capture_move(m, st->capture, them, to); + do_capture_move(st->capture, them, to); // Move the piece clear_bit(&(byColorBB[us]), from); @@ -848,7 +848,7 @@ void Position::do_move(Move m, StateInfo& newSt, Bitboard dcCandidates) { /// Position::do_capture_move() is a private method used to update captured /// piece info. It is called from the main Position::do_move function. -void Position::do_capture_move(Move m, PieceType capture, Color them, Square to) { +void Position::do_capture_move(PieceType capture, Color them, Square to) { assert(capture != KING); @@ -1010,7 +1010,7 @@ void Position::do_promotion_move(Move m) { st->capture = type_of_piece_on(to); if (st->capture) - do_capture_move(m, st->capture, them, to); + do_capture_move(st->capture, them, to); // Remove pawn clear_bit(&(byColorBB[us]), from); @@ -1618,7 +1618,7 @@ int Position::see(Square from, Square to) const { // Remove the attacker we just found from the 'attackers' bitboard, // and scan for new X-ray attacks behind the attacker. b = attackers & pieces_of_color_and_type(c, pt); - occ ^= (b & -b); + occ ^= (b & (~b + 1)); attackers |= (rook_attacks_bb(to, occ) & rooks_and_queens()) | (bishop_attacks_bb(to, occ) & bishops_and_queens());