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

Nullkiller: initial decomposition

This commit is contained in:
Andrii Danylchenko
2021-05-16 14:38:53 +03:00
committed by Andrii Danylchenko
parent 223a52b3d1
commit 8f8c5ca255
52 changed files with 737 additions and 426 deletions

View File

@@ -1033,13 +1033,16 @@ void AINodeStorage::fillChainInfo(const AIPathNode * node, AIPath & path, int pa
pathNode.coord = node->coord;
pathNode.parentIndex = parentIndex;
if(pathNode.specialAction)
{
pathNode.actionIsBlocked = !pathNode.specialAction->canAct(node);
}
parentIndex = path.nodes.size();
path.nodes.push_back(pathNode);
}
path.specialAction = node->specialAction;
node = getAINode(node->theNodeBefore);
}
}
@@ -1049,15 +1052,15 @@ AIPath::AIPath()
{
}
std::shared_ptr<const ISpecialAction> AIPath::getFirstBlockedAction() const
std::shared_ptr<const SpecialAction> AIPath::getFirstBlockedAction() const
{
for(auto node : nodes)
{
if(node.specialAction && !node.specialAction->canAct(node.targetHero))
if(node.specialAction && node.actionIsBlocked)
return node.specialAction;
}
return std::shared_ptr<const ISpecialAction>();
return std::shared_ptr<const SpecialAction>();
}
int3 AIPath::firstTileToGet() const