X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmove.cpp;h=da9e977dc611633e361db33e36467d46030777c4;hp=96215e82478e7348654c1ce9ad5dd1e84946d874;hb=8f51f09de7813ebc0f5f3efb9d0c142b884faeb3;hpb=c9d7e99de682516c560009b550c41da9ae2008b8 diff --git a/src/move.cpp b/src/move.cpp index 96215e82..da9e977d 100644 --- a/src/move.cpp +++ b/src/move.cpp @@ -66,7 +66,8 @@ const string move_to_uci(Move m, bool chess960) { /// move_from_uci() takes a position and a string representing a move in -/// simple coordinate notation and returns an equivalent Move. +/// simple coordinate notation and returns an equivalent Move if any. +/// Moves are guaranteed to be legal. Move move_from_uci(const Position& pos, const string& str) { @@ -155,11 +156,11 @@ const string move_to_san(Position& pos, Move m) { } } - // The move gives check? We don't use pos.move_is_check() here + // The move gives check? We don't use pos.move_gives_check() here // because we need to test for a mate after the move is done. StateInfo st; pos.do_move(m, st); - if (pos.is_check()) + if (pos.in_check()) san += pos.is_mate() ? "#" : "+"; pos.undo_move(m);