Catch more potential engine hangs
If the engine thinks the game is over, but we don't, report an error.
This commit is contained in:
parent
ac4126cc8e
commit
b72e2f5627
1 changed files with 7 additions and 6 deletions
|
@ -64,17 +64,18 @@ public class ChessEngineCECP : ChessEngine
|
|||
}
|
||||
}
|
||||
|
||||
if (line.has_prefix ("Illegal move: "))
|
||||
{
|
||||
stop ();
|
||||
error ();
|
||||
}
|
||||
else if (line == "resign" || line == "tellics resign" ||
|
||||
if (line == "resign" || line == "tellics resign" ||
|
||||
(line.has_prefix ("1-0 {") && line.contains("resign")) ||
|
||||
(line.has_prefix ("0-1 {") && line.contains("resign")))
|
||||
{
|
||||
resigned ();
|
||||
}
|
||||
else if (line.has_prefix ("Illegal move: ") ||
|
||||
line.has_prefix ("1-0") || line.has_prefix ("0-1"))
|
||||
{
|
||||
stop ();
|
||||
error ();
|
||||
}
|
||||
else if (line == "game is a draw" ||
|
||||
line == "draw" ||
|
||||
line == "Draw" ||
|
||||
|
|
Loading…
Reference in a new issue