X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fposition.cpp;h=ec4fa14e8692fc5cddcd0dc026358625f7821d7d;hb=ad0fdf0da6d9fdc38a5ceb96eeed0d79c8e38dc9;hp=e71499ce9b35a02177b23872b12bd8b330de5035;hpb=4dc7ba16191bd1ded7c8257afd2a3b9194cebca8;p=stockfish diff --git a/src/position.cpp b/src/position.cpp index e71499ce..ec4fa14e 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1490,12 +1490,6 @@ void Position::undo_null_move() { /// move, and one which takes a 'from' and a 'to' square. The function does /// not yet understand promotions captures. -int Position::see(Move m) const { - - assert(move_is_ok(m)); - return see(move_from(m), move_to(m)); -} - int Position::see_sign(Move m) const { assert(move_is_ok(m)); @@ -1509,19 +1503,21 @@ int Position::see_sign(Move m) const { if (midgame_value_of_piece_on(to) >= midgame_value_of_piece_on(from)) return 1; - return see(from, to); + return see(m); } -int Position::see(Square from, Square to) const { +int Position::see(Move m) const { + Square from, to; Bitboard occupied, attackers, stmAttackers, b; int swapList[32], slIndex = 1; PieceType capturedType, pt; Color stm; - assert(square_is_ok(from)); - assert(square_is_ok(to)); + assert(move_is_ok(m)); + from = move_from(m); + to = move_to(m); capturedType = type_of_piece_on(to); // King cannot be recaptured