1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-19 21:10:12 +02:00

Update PriorityEvaluator.cpp

If there's several valid defense-tasks use the one that takes fewer turns to get to.
This commit is contained in:
Xilmi 2025-01-15 15:10:45 +01:00 committed by Ivan Savenko
parent b3eecf431c
commit c9f669b41d

View File

@ -1458,7 +1458,7 @@ float PriorityEvaluator::evaluate(Goals::TSubgoal task, int priorityTier)
if (evaluationContext.isEnemy && evaluationContext.turn > 0) if (evaluationContext.isEnemy && evaluationContext.turn > 0)
return 0; return 0;
if (evaluationContext.isDefend && evaluationContext.threatTurns <= evaluationContext.turn) if (evaluationContext.isDefend && evaluationContext.threatTurns <= evaluationContext.turn)
score = evaluationContext.armyInvolvement; score = evaluationContext.armyInvolvement / (evaluationContext.turn + 1);
break; break;
} }
case PriorityTier::KILL: //Take towns / kill heroes that are further away case PriorityTier::KILL: //Take towns / kill heroes that are further away