From: Fabian Fichter Date: Thu, 7 May 2020 18:36:34 +0000 (+0200) Subject: CECP compatible passing moves X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=c231fb75b452035d4855386e9609fb61c840e407;p=fairystockfish.git CECP compatible passing moves Use `pass` for passing moves in CECP to improve Winboard compatibility. --- diff --git a/src/uci.cpp b/src/uci.cpp index 49afa05..93d1180 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -391,6 +391,9 @@ string UCI::move(const Position& pos, Move m) { if (m == MOVE_NULL) return "0000"; + if (is_pass(m) && Options["Protocol"] == "xboard") + return "pass"; + if (is_gating(m) && gating_square(m) == to) from = to_sq(m), to = from_sq(m); else if (type_of(m) == CASTLING && !pos.is_chess960()) @@ -428,7 +431,7 @@ Move UCI::to_move(const Position& pos, string& str) { } for (const auto& m : MoveList(pos)) - if (str == UCI::move(pos, m)) + if (str == UCI::move(pos, m) || (is_pass(m) && str == UCI::square(pos, from_sq(m)) + UCI::square(pos, to_sq(m)))) return m; return MOVE_NONE;