1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Update PriorityEvaluator.cpp

The army loss will no longer affect the score for defensive decisions.
This commit is contained in:
Xilmi
2024-10-21 08:59:18 +02:00
parent d93c6211da
commit 76f5d925e6

View File

@@ -1401,8 +1401,8 @@ float PriorityEvaluator::evaluate(Goals::TSubgoal task, int priorityTier)
{
if (evaluationContext.isDefend && evaluationContext.threatTurns == 0 && evaluationContext.turn == 0)
score = evaluationContext.armyInvolvement;
if (evaluationContext.isEnemy)
score *= (maxWillingToLose - evaluationContext.armyLossPersentage);
if (evaluationContext.isEnemy && maxWillingToLose - evaluationContext.armyLossPersentage < 0)
return 0;
score *= evaluationContext.closestWayRatio;
break;
}