mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-17 20:58:07 +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:
parent
b3eecf431c
commit
c9f669b41d
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user