mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Important fixes:
- AI will not always trade resources if it has better options - Do not use reserved objects for CollectRes
This commit is contained in:
@@ -1142,10 +1142,11 @@ TGoalVec Goals::CollectRes::getAllPossibleSubgoals()
|
||||
}
|
||||
for (auto obj : ourObjs)
|
||||
{
|
||||
if (ai->isAccessibleForHero(obj->visitablePos(), h))
|
||||
auto pos = obj->visitablePos();
|
||||
if (ai->isAccessibleForHero(pos, h))
|
||||
{
|
||||
//further decomposition and evaluation will be handled by VisitObj
|
||||
ret.push_back(sptr(Goals::VisitObj(obj->id.getNum()).sethero(h).setisAbstract(true)));
|
||||
if (ai->isTileNotReserved(h, pos)) //further decomposition and evaluation will be handled by VisitObj
|
||||
ret.push_back(sptr(Goals::VisitObj(obj->id.getNum()).sethero(h).setisAbstract(true)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -432,7 +432,7 @@ public:
|
||||
resID = rid;
|
||||
value = val;
|
||||
objid = Objid;
|
||||
priority = 10; //do it immediately
|
||||
priority = 3; //trading is instant, but picking resources is free
|
||||
}
|
||||
TSubgoal whatToDoToAchieve() override;
|
||||
bool operator==(AbstractGoal & g) override;
|
||||
|
Reference in New Issue
Block a user