From: Fabian Fichter Date: Wed, 28 Oct 2020 17:20:58 +0000 (+0100) Subject: Fix CECP error message for illegal moves X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=fda29e1d1b362c9bf32686e018085c3abd014003;p=fairystockfish.git Fix CECP error message for illegal moves Closes #203. --- diff --git a/src/xboard.cpp b/src/xboard.cpp index 495b91a..a62d709 100644 --- a/src/xboard.cpp +++ b/src/xboard.cpp @@ -375,8 +375,12 @@ void StateMachine::process_command(Position& pos, std::string token, std::istrin else { // process move string + bool isMove = false; if (token == "usermove") + { is >> token; + isMove = true; + } if (Options["UCI_AnalyseMode"]) { Threads.stop = true; @@ -386,7 +390,7 @@ void StateMachine::process_command(Position& pos, std::string token, std::istrin if ((m = UCI::to_move(pos, token)) != MOVE_NONE) do_move(pos, moveList, states, m); else - sync_cout << "Error (unknown command): " << token << sync_endl; + sync_cout << (isMove ? "Illegal move: " : "Error (unknown command): ") << token << sync_endl; if (Options["UCI_AnalyseMode"]) go(pos, analysisLimits, states); else if (pos.side_to_move() == playColor)