diff --git a/src/move.cpp b/src/move.cpp index 2a18c1c4..cb6b5dfd 100644 --- a/src/move.cpp +++ b/src/move.cpp @@ -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 } diff --git a/src/move.h b/src/move.h index c4ed9dd8..d06e381a 100644 --- a/src/move.h +++ b/src/move.h @@ -207,5 +207,4 @@ extern Move move_from_uci(const Position& pos, const std::string &str); extern const std::string move_to_uci(Move m, bool chess960); extern bool move_is_ok(Move m); - #endif // !defined(MOVE_H_INCLUDED) diff --git a/src/square.h b/src/square.h index f89c72ee..46456d06 100644 --- a/src/square.h +++ b/src/square.h @@ -177,7 +177,7 @@ inline bool rank_is_ok(Rank r) { } inline bool square_is_ok(Square s) { - return file_is_ok(square_file(s)) && rank_is_ok(square_rank(s)); + return s >= SQ_A1 && s <= SQ_H8; } #endif // !defined(SQUARE_H_INCLUDED)