1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-15 13:33:36 +02:00

Update PriorityEvaluator.cpp

AI will be more aggressive when defending their territory. And more aggressive means more willing to take losses while fighting.
This commit is contained in:
Xilmi 2024-10-10 18:53:28 +02:00
parent 6adaffa2c2
commit eb94c9f0be

View File

@ -1345,7 +1345,7 @@ float PriorityEvaluator::evaluate(Goals::TSubgoal task, int priorityTier)
else
{
float score = 0;
float maxWillingToLose = ai->cb->getTownsInfo().empty() ? 1 : 0.25;
float maxWillingToLose = ai->cb->getTownsInfo().empty() || (evaluationContext.isDefend && evaluationContext.threatTurns == 0) ? 1 : 0.25;
bool arriveNextWeek = false;
if (ai->cb->getDate(Date::DAY_OF_WEEK) + evaluationContext.turn > 7)