X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=f24c2f2c0c3d72c1bb332b5589bdc71f6edd0781;hp=2b6e2b4c07a5e84640d839cd6aca37b77abf9f6d;hb=eaed535c5f00ee75185e798dc2fe445a11e396af;hpb=84ec1f7331f402f4ab2e2201b72b3ee378cce659 diff --git a/src/position.cpp b/src/position.cpp index 2b6e2b4c..f24c2f2c 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--) { @@ -1672,6 +1673,7 @@ Value Position::compute_non_pawn_material(Color c) const { /// Position::is_draw() tests whether the position is drawn by material, /// repetition, or the 50 moves rule. It does not detect stalemates, this /// must be done by the search. +// FIXME: Currently we are not handling 50 move rule correctly when in check bool Position::is_draw() const { @@ -1685,7 +1687,7 @@ bool Position::is_draw() const { return true; // Draw by repetition? - for (int i = 2; i < Min(Min(gamePly, st->rule50), st->pliesFromNull); i += 2) + for (int i = 4; i <= Min(Min(gamePly, st->rule50), st->pliesFromNull); i += 2) if (history[gamePly - i] == st->key) return true;