1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-21 00:19:29 +02:00

Better handling of AI shutdown

This commit is contained in:
Ivan Savenko
2025-03-02 12:56:01 +00:00
parent 5f052165fe
commit 219eea86ff
6 changed files with 46 additions and 18 deletions

View File

@ -653,6 +653,8 @@ void CServerHandler::showHighScoresAndEndGameplay(PlayerColor player, bool victo
void CServerHandler::endGameplay()
{
client->finishGameplay();
// Game is ending
// Tell the network thread to reach a stable state
sendClientDisconnecting();
@ -671,6 +673,7 @@ void CServerHandler::endGameplay()
void CServerHandler::restartGameplay()
{
client->finishGameplay();
client->endGame();
client.reset();