Răsfoiți Sursa

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.
Xilmi 1 an în urmă
părinte
comite
fba34a743e
1 a modificat fișierele cu 4 adăugiri și 0 ștergeri
  1. 4 0
      AI/Nullkiller/Behaviors/DefenceBehavior.cpp

+ 4 - 0
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());