mirror of
https://github.com/sockspls/badfish
synced 2025-07-13 12:39:16 +00:00
Fix silly bug in uci loop
After issuing "go"-command, at the end of the search SF shows: "Unknown command: ...". Spotted by Joona. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
b6b0878da8
commit
7902d6089e
1 changed files with 6 additions and 5 deletions
11
src/uci.cpp
11
src/uci.cpp
|
@ -58,20 +58,21 @@ void uci_loop() {
|
|||
|
||||
Position pos(StarFEN, false, 0); // The root position
|
||||
string cmd, token;
|
||||
bool quit = false;
|
||||
|
||||
while (getline(cin, cmd))
|
||||
while (!quit && getline(cin, cmd))
|
||||
{
|
||||
istringstream is(cmd);
|
||||
|
||||
is >> skipws >> token;
|
||||
|
||||
if (token == "quit")
|
||||
break;
|
||||
quit = true;
|
||||
|
||||
if (token == "go" && !go(pos, is))
|
||||
break;
|
||||
else if (token == "go")
|
||||
quit = !go(pos, is);
|
||||
|
||||
if (token == "ucinewgame")
|
||||
else if (token == "ucinewgame")
|
||||
pos.from_fen(StarFEN, false);
|
||||
|
||||
else if (token == "isready")
|
||||
|
|
Loading…
Add table
Reference in a new issue