mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
NKAI: replace hardcoded pandora with more flexible solution
This commit is contained in:
@@ -141,12 +141,18 @@ std::optional<const CGObjectInstance *> ObjectClusterizer::getBlocker(const AIPa
|
||||
|| blocker->ID == Obj::BORDERGUARD
|
||||
|| blocker->ID == Obj::BORDER_GATE
|
||||
|| blocker->ID == Obj::SHIPYARD
|
||||
|| blocker->ID == Obj::PANDORAS_BOX
|
||||
|| (blocker->ID == Obj::QUEST_GUARD && node.actionIsBlocked))
|
||||
{
|
||||
return blocker;
|
||||
}
|
||||
|
||||
auto danger = ai->dangerEvaluator->evaluateDanger(blocker);
|
||||
|
||||
if(danger > 0 && blocker->isBlockedVisitable() && isObjectRemovable(blocker))
|
||||
{
|
||||
return blocker;
|
||||
}
|
||||
|
||||
return std::optional< const CGObjectInstance *>();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user