From fba34a743ef4e7e1e02bd76ee34574ff6f562bee Mon Sep 17 00:00:00 2001 From: Xilmi Date: Sun, 11 Aug 2024 18:23:52 +0200 Subject: [PATCH] Update DefenceBehavior.cpp Reverted previous change to defense-behavior. Both approaches have pros and cons and neither really works as I want. This still needs work. --- AI/Nullkiller/Behaviors/DefenceBehavior.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AI/Nullkiller/Behaviors/DefenceBehavior.cpp b/AI/Nullkiller/Behaviors/DefenceBehavior.cpp index 7487791b2..a740d48fd 100644 --- a/AI/Nullkiller/Behaviors/DefenceBehavior.cpp +++ b/AI/Nullkiller/Behaviors/DefenceBehavior.cpp @@ -158,6 +158,10 @@ void DefenceBehavior::evaluateDefence(Goals::TGoalVec & tasks, const CGTownInsta threats.push_back(threatNode.fastestDanger); // no guarantee that fastest danger will be there + if (town->garrisonHero && handleGarrisonHeroFromPreviousTurn(town, tasks, ai)) + { + return; + } if(!threatNode.fastestDanger.hero) { logAi->trace("No threat found for town %s", town->getNameTranslated());