X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmove.cpp;h=cb6b5dfdc3bd80ad27f6e3e1dc100103ca86c69d;hp=5ea874e07575bd03ed2087d26766478e0f47e8c0;hb=916c0cbfbca460e358357b5ff55fb02b40e7142d;hpb=56de5ae5616bf8766491d2585751b11da268559c diff --git a/src/move.cpp b/src/move.cpp index 5ea874e0..cb6b5dfd 100644 --- a/src/move.cpp +++ b/src/move.cpp @@ -75,7 +75,7 @@ Move move_from_uci(const Position& pos, const std::string& str) { // En passant move? We assume that a pawn move is an en passant move // if the destination square is epSquare. if (to == pos.ep_square() && piece == piece_of_color_and_type(us, PAWN)) - make_ep_move(from, to); + return make_ep_move(from, to); // Is this a castling move? A king move is assumed to be a castling move // if the destination square is occupied by a friendly rook, or if the @@ -135,7 +135,7 @@ const std::string move_to_uci(Move move, bool chess960) { } -/// Overload the << operator, to make it easier to print moves. +/// Overload the << operator, to make it easier to print moves std::ostream& operator << (std::ostream& os, Move m) { @@ -144,9 +144,9 @@ std::ostream& operator << (std::ostream& os, Move m) { } -/// move_is_ok(), for debugging. +/// move_is_ok(), for debugging bool move_is_ok(Move m) { - return square_is_ok(move_from(m)) && square_is_ok(move_to(m)); + return move_from(m) != move_to(m); // Catches also MOVE_NONE }