Pārlūkot izejas kodu

Small adjustments to defensive behavior

AI will no longer leave the defense of a threatened town in order to bring the army to another hero.

AI will no longer send heroes to die outside of towns that already have a garrisioning hero inside, if there's a stronger enemy hero lurking around the town.
Xilmi 10 mēneši atpakaļ
vecāks
revīzija
c7b875f671
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2 2
      AI/Nullkiller/Engine/PriorityEvaluator.cpp

+ 2 - 2
AI/Nullkiller/Engine/PriorityEvaluator.cpp

@@ -1460,7 +1460,7 @@ float PriorityEvaluator::evaluate(Goals::TSubgoal task, int priorityTier)
 		{
 			case PriorityTier::INSTAKILL: //Take towns / kill heroes in immediate reach
 			{
-				if (evaluationContext.turn > 0)
+				if (evaluationContext.turn > 0 || evaluationContext.isExchange)
 					return 0;
 				if (evaluationContext.movementCost >= 1)
 					return 0;
@@ -1594,7 +1594,7 @@ float PriorityEvaluator::evaluate(Goals::TSubgoal task, int priorityTier)
 			}
 			case PriorityTier::DEFEND: //Defend whatever if nothing else is to do
 			{
-				if (evaluationContext.enemyHeroDangerRatio > dangerThreshold && evaluationContext.isExchange)
+				if (evaluationContext.enemyHeroDangerRatio > dangerThreshold)
 					return 0;
 				if (evaluationContext.isDefend || evaluationContext.isArmyUpgrade)
 					score = evaluationContext.armyInvolvement;