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

Nullkiller: capture guarded artifacts and other fixes

This commit is contained in:
Andrii Danylchenko
2021-05-16 14:22:41 +03:00
committed by Andrii Danylchenko
parent 1fd838a5b9
commit 5344df51c6
7 changed files with 80 additions and 19 deletions

View File

@@ -123,9 +123,6 @@ Goals::TGoalVec CaptureObjectsBehavior::getTasks()
if(ai->nullkiller->arePathHeroesLocked(way->getPath()))
continue;
if(ai->nullkiller->getHeroLockedReason(way->hero.get()) == HeroLockedReason::STARTUP)
continue;
way->evaluationContext.closestWayRatio
= closestWay->evaluationContext.movementCost / way->evaluationContext.movementCost;
@@ -149,7 +146,6 @@ Goals::TGoalVec CaptureObjectsBehavior::getTasks()
bool CaptureObjectsBehavior::shouldVisitObject(ObjectIdRef obj) const
{
const CGObjectInstance* objInstance = obj;
if(!objInstance)
return false;
@@ -162,6 +158,11 @@ bool CaptureObjectsBehavior::shouldVisitObject(ObjectIdRef obj) const
{
return false;
}
if(isObjectRemovable(obj))
{
return true;
}
const int3 pos = objInstance->visitablePos();