mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
Battle AI: add some comments + refactoring
This commit is contained in:
@@ -180,13 +180,14 @@ std::vector<CGPathNode *> AINodeStorage::getInitialNodes()
|
||||
for(auto actorPtr : actors)
|
||||
{
|
||||
ChainActor * actor = actorPtr.get();
|
||||
AIPathNode * initialNode =
|
||||
getOrCreateNode(actor->initialPosition, actor->layer, actor)
|
||||
.get();
|
||||
|
||||
if(!initialNode)
|
||||
auto allocated = getOrCreateNode(actor->initialPosition, actor->layer, actor);
|
||||
|
||||
if(!allocated)
|
||||
continue;
|
||||
|
||||
AIPathNode * initialNode = allocated.get();
|
||||
|
||||
initialNode->inPQ = false;
|
||||
initialNode->pq = nullptr;
|
||||
initialNode->turns = actor->initialTurn;
|
||||
|
||||
Reference in New Issue
Block a user