1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +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

@@ -884,7 +884,15 @@ void AIGateway::makeTurn()
}
#endif
endTurn();
try
{
endTurn();
}
catch (const TerminationRequestedException & e)
{
logAi->debug("Making turn thread has been interrupted. We'll end without calling endTurn.");
return;
}
}
void AIGateway::performObjectInteraction(const CGObjectInstance * obj, HeroPtr h)