X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=2508db669dfb2241ed0e4c322fbfb6fbd8d0cfe0;hp=2b6e2b4c07a5e84640d839cd6aca37b77abf9f6d;hb=252844e899515d48c0db1153ef5e91bdd8c6679f;hpb=84ec1f7331f402f4ab2e2201b72b3ee378cce659 diff --git a/src/position.cpp b/src/position.cpp index 2b6e2b4c..2508db66 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -356,8 +356,9 @@ void Position::print(Move m) const { std::cout << std::endl; if (m != MOVE_NONE) { + Position p(*this); string col = (color_of_piece_on(move_from(m)) == BLACK ? ".." : ""); - std::cout << "Move is: " << col << move_to_san(*this, m) << std::endl; + std::cout << "Move is: " << col << move_to_san(p, m) << std::endl; } for (Rank rank = RANK_8; rank >= RANK_1; rank--) { @@ -1300,6 +1301,11 @@ void Position::undo_null_move() { } +/// +PieceType Position::captured_piece() const { + return st->capture; +} + /// Position::see() is a static exchange evaluator: It tries to estimate the /// material gain or loss resulting from a move. There are three versions of /// this function: One which takes a destination square as input, one takes a