mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-13 11:40:38 +02:00
Update PriorityEvaluator.cpp
Prevent building more buildings when we are saving for our favorite building.
This commit is contained in:
parent
751f3b0e7d
commit
1ef5e8ab1b
@ -1208,7 +1208,7 @@ public:
|
||||
int32_t cost = bi.buildCost[EGameResID::GOLD];
|
||||
evaluationContext.goldCost += cost;
|
||||
evaluationContext.closestWayRatio = 1;
|
||||
evaluationContext.buildingCost += bi.buildCost;
|
||||
evaluationContext.buildingCost += bi.buildCostWithPrerequisites;
|
||||
if (bi.id == BuildingID::MARKETPLACE || bi.dailyIncome[EGameResID::WOOD] > 0)
|
||||
evaluationContext.isTradeBuilding = true;
|
||||
|
||||
@ -1503,6 +1503,9 @@ float PriorityEvaluator::evaluate(Goals::TSubgoal task, int priorityTier)
|
||||
{
|
||||
if (maxWillingToLose - evaluationContext.armyLossPersentage < 0)
|
||||
return 0;
|
||||
//If we already have locked resources, we don't look at other buildings
|
||||
if (ai->getLockedResources().marketValue() > 0)
|
||||
return 0;
|
||||
score += evaluationContext.conquestValue * 1000;
|
||||
score += evaluationContext.strategicalValue * 1000;
|
||||
score += evaluationContext.goldReward;
|
||||
|
Loading…
x
Reference in New Issue
Block a user