Преглед изворни кода

Update DefenceBehavior.cpp

Only hire heroes for defence if the enemy is already really close. (Otherwise AI hired too many heroes from defensebehavior)
Xilmi пре 1 година
родитељ
комит
e7e3f6dcbe
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      AI/Nullkiller/Behaviors/DefenceBehavior.cpp

+ 3 - 0
AI/Nullkiller/Behaviors/DefenceBehavior.cpp

@@ -404,6 +404,9 @@ void DefenceBehavior::evaluateDefence(Goals::TGoalVec & tasks, const CGTownInsta
 
 void DefenceBehavior::evaluateRecruitingHero(Goals::TGoalVec & tasks, const HitMapInfo & threat, const CGTownInstance * town, const Nullkiller * ai) const
 {
+	if (threat.turn > 0)
+		return;
+	
 	if(town->hasBuilt(BuildingID::TAVERN)
 		&& ai->cb->getResourceAmount(EGameResID::GOLD) > GameConstants::HERO_GOLD_COST)
 	{