1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:07:45 +00:00

Chess: Send a ucinewgame command to the engine on starting a new game

This fixes an issue where the engine would crash when starting a new
game playing as white.
This commit is contained in:
Tim Ledbetter 2023-04-26 19:03:48 +01:00 committed by Andreas Kling
parent 536f6b8b34
commit 482f7f9775
2 changed files with 12 additions and 0 deletions

View file

@ -38,6 +38,15 @@ public:
m_bestmove_callback = move(callback);
}
void start_new_game()
{
if (!m_connected)
return;
Chess::UCI::UCINewGameCommand ucinewgame_command;
send_command(ucinewgame_command);
}
private:
void quit();
void connect_to_engine_service();