浏览代码

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)
 	{