From: Rick Date: Wed, 5 Oct 2022 21:25:53 +0000 (-0700) Subject: Update xboard.cpp - remove command X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=e5a2577c931ffc99c955a1b02ca0091ad19f8a8d;p=fairystockfish.git Update xboard.cpp - remove command Adding remove command xboard sends with CTRL+X, only sent when player's turn, go back two moves to players previous turn. Allows player to go back and try different moves without engine stopping like undo, see https://www.gnu.org/software/xboard/engine-intf.html#8 for differences between undo and remove. --- diff --git a/src/xboard.cpp b/src/xboard.cpp index 8368eb3..482b5e4 100644 --- a/src/xboard.cpp +++ b/src/xboard.cpp @@ -380,6 +380,17 @@ void StateMachine::process_command(std::string token, std::istringstream& is) { go(analysisLimits); } } + else if (token == "remove") + { + stop(); + if (moveList.size()) + { + undo_move(); + undo_move(); + if (Options["UCI_AnalyseMode"]) + go(analysisLimits); + } + } // Bughouse commands else if (token == "partner") Partner.parse_partner(is); @@ -482,4 +493,4 @@ void StateMachine::process_command(std::string token, std::istringstream& is) { } // namespace XBoard -} // namespace Stockfish \ No newline at end of file +} // namespace Stockfish