1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-14 02:33:51 +02:00

Update DefenceBehavior.cpp

Fixed an issue that caused the AI to try buying the same hero in two different towns.
This commit is contained in:
Xilmi 2024-10-31 00:41:51 +01:00
parent ffd8758017
commit 9d2fc1b1c9

View File

@ -41,6 +41,9 @@ Goals::TGoalVec DefenceBehavior::decompose(const Nullkiller * ai) const
for(auto town : ai->cb->getTownsInfo())
{
evaluateDefence(tasks, town, ai);
//Let's do only one defence-task per pass since otherwise it can try to hire the same hero twice
if (!tasks.empty())
break;
}
return tasks;