# if we're already thinking on something, stop and wait for the engine
# to approve
if (defined($pos_calculating)) {
- uciprint("stop");
+ if (!defined($pos_waiting)) {
+ uciprint("stop");
+ }
$pos_waiting = $pos;
} else {
# it's wrong just to give the FEN (the move history is useful,