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

NK: fix AI speed

This commit is contained in:
Andrii Danylchenko
2022-09-06 21:14:22 +03:00
parent a2dbb6c8ac
commit 2434fe3f6f
14 changed files with 264 additions and 150 deletions

View File

@@ -120,18 +120,23 @@ const CGObjectInstance * ObjectClusterizer::getBlocker(const AIPath & path) cons
auto blocker = blockers.front();
if(isObjectPassable(ai, blocker))
continue;
if(blocker->ID == Obj::GARRISON
|| blocker->ID == Obj::MONSTER
|| blocker->ID == Obj::GARRISON2
|| blocker->ID == Obj::BORDERGUARD
|| blocker->ID == Obj::BORDER_GATE
|| blocker->ID == Obj::SHIPYARD)
|| blocker->ID == Obj::GARRISON2)
{
if(!isObjectPassable(ai, blocker))
if(dynamic_cast<const CArmedInstance *>(blocker)->getArmyStrength() == 0)
continue;
else
return blocker;
}
if(blocker->ID == Obj::QUEST_GUARD && node->actionIsBlocked)
if(blocker->ID == Obj::MONSTER
|| blocker->ID == Obj::BORDERGUARD
|| blocker->ID == Obj::BORDER_GATE
|| blocker->ID == Obj::SHIPYARD
|| (blocker->ID == Obj::QUEST_GUARD && node->actionIsBlocked))
{
return blocker;
}