Skip to content

Commit

Permalink
Fix move time for CECP
Browse files Browse the repository at this point in the history
Ensure full usage of time specified by `st`.
  • Loading branch information
ianfab committed Sep 21, 2020
1 parent 72c8a58 commit feb9ffa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/xboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit feb9ffa

Please sign in to comment.