Fix searchmoves option in go command (bench 2346157)

This commit is contained in:
Mattia Giambirtone 2024-07-11 00:01:02 +02:00
parent 65f27a57f7
commit 2f6ddcf01f
Signed by: nocturn9x
GPG Key ID: 37B83AB6C3BE6514
1 changed files with 1 additions and 1 deletions

View File

@ -190,13 +190,13 @@ proc handleUCIGoCommand(session: UCISession, command: seq[string]): UCICommand =
result.nodes = command[current].parseBiggestUInt()
of "searchmoves":
while current < command.len():
inc(current)
if command[current] == "":
break
let move = session.history[^1].parseUCIMove(command[current]).move
if move == nullMove():
return UCICommand(kind: Unknown, reason: &"invalid move '{command[current]}' for searchmoves")
result.searchmoves.add(move)
inc(current)
else:
discard