1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

NKAI: stability fixes and regression

This commit is contained in:
Andrii Danylchenko
2024-04-20 10:33:37 +03:00
parent ed76d8a652
commit 3939c4b9d3
7 changed files with 52 additions and 6 deletions

View File

@@ -318,7 +318,7 @@ void Nullkiller::makeTurn()
Goals::TGoalVec bestTasks;
for(int i = 1; i <= settings->getMaxPass(); i++)
for(int i = 1; i <= settings->getMaxPass() && cb->getPlayerStatus(playerID) == EPlayerStatus::INGAME; i++)
{
auto start = std::chrono::high_resolution_clock::now();
updateAiState(i);
@@ -372,6 +372,9 @@ void Nullkiller::makeTurn()
for(auto bestTask : selectedTasks)
{
if(cb->getPlayerStatus(playerID) != EPlayerStatus::INGAME)
return;
std::string taskDescription = bestTask->toString();
HeroPtr hero = bestTask->getHero();
HeroRole heroRole = HeroRole::MAIN;