From: Fabian Fichter Date: Mon, 21 Sep 2020 15:22:13 +0000 (+0200) Subject: Fix move time for CECP X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=feb9ffa5813080ac135862a2972cd80508e67569;p=fairystockfish.git Fix move time for CECP Ensure full usage of time specified by `st`. --- diff --git a/src/xboard.cpp b/src/xboard.cpp index b360db2..c4f9c1d 100644 --- a/src/xboard.cpp +++ b/src/xboard.cpp @@ -221,17 +221,22 @@ void StateMachine::process_command(Position& pos, std::string token, std::istrin { is >> num; limits.movetime = num * 1000; + limits.time[WHITE] = limits.time[BLACK] = 0; } // Note: time/otim are in centi-, not milliseconds else if (token == "time") { is >> num; - limits.time[playColor != COLOR_NB ? playColor : pos.side_to_move()] = num * 10; + Color us = playColor != COLOR_NB ? playColor : pos.side_to_move(); + if (limits.time[us]) + limits.time[us] = num * 10; } else if (token == "otim") { is >> num; - limits.time[playColor != COLOR_NB ? ~playColor : ~pos.side_to_move()] = num * 10; + Color them = playColor != COLOR_NB ? ~playColor : ~pos.side_to_move(); + if (limits.time[them]) + limits.time[them] = num * 10; } } else if (token == "setboard")