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:
committed by
Andrii Danylchenko
parent
223a52b3d1
commit
8f8c5ca255
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user