mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Nullkiller: stabilization
This commit is contained in:
committed by
Andrii Danylchenko
parent
dec723b4be
commit
37f49f2ac5
@ -178,6 +178,11 @@ Goals::TGoalVec CaptureObjectsBehavior::decompose() const
|
||||
#endif
|
||||
vstd::concatenate(tasks, getVisitGoals(paths, objToVisit));
|
||||
}
|
||||
|
||||
vstd::erase_if(tasks, [](TSubgoal task) -> bool
|
||||
{
|
||||
return task->invalid();
|
||||
});
|
||||
};
|
||||
|
||||
if(specificObjects)
|
||||
@ -187,12 +192,10 @@ Goals::TGoalVec CaptureObjectsBehavior::decompose() const
|
||||
else
|
||||
{
|
||||
captureObjects(ai->nullkiller->objectClusterizer->getNearbyObjects());
|
||||
}
|
||||
|
||||
vstd::erase_if(tasks, [](TSubgoal task) -> bool
|
||||
{
|
||||
return task->invalid();
|
||||
});
|
||||
if(tasks.empty())
|
||||
captureObjects(ai->nullkiller->objectClusterizer->getFarObjects());
|
||||
}
|
||||
|
||||
return tasks;
|
||||
}
|
||||
|
Reference in New Issue
Block a user