From eab6de4686082ceb780c96f0235c95967db224eb Mon Sep 17 00:00:00 2001 From: Xilmi Date: Tue, 10 Dec 2024 19:21:23 +0100 Subject: [PATCH] Fixed an issue that could cause the AI to skip almost their entire turn If the best Task is to recruit a hero this now triggers pathfinding again as the newly bought hero may impair other heroe's paths. --- AI/Nullkiller/Engine/Nullkiller.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/AI/Nullkiller/Engine/Nullkiller.cpp b/AI/Nullkiller/Engine/Nullkiller.cpp index c21f1c57d..b2c3d0eb1 100644 --- a/AI/Nullkiller/Engine/Nullkiller.cpp +++ b/AI/Nullkiller/Engine/Nullkiller.cpp @@ -397,7 +397,12 @@ void Nullkiller::makeTurn() if(!executeTask(bestTask)) return; - updateAiState(i, true); + bool fastUpdate = true; + + if (bestTask->getHero() != nullptr) + fastUpdate = false; + + updateAiState(i, fastUpdate); } else {