propagated the temporary fix for Neighbors up to A*
This commit is contained in:
@ -117,6 +117,7 @@ TArray<AHexTile*> AAdventureMap::AStar(AHexTile* Start, AHexTile* Goal)
|
||||
|
||||
// expand frontier & adjust path data
|
||||
for (AHexTile* Neighbor : Neighbors(Candidate)) {
|
||||
if (Neighbor->Distance(Candidate) > 1) { continue; }
|
||||
if (Processed.Contains(Neighbor)) { continue; }
|
||||
|
||||
bool bInToExamine = ToExamine.Contains(Neighbor);
|
||||
@ -144,14 +145,8 @@ TArray<AHexTile*> AAdventureMap::LinkPath(AHexTile* Start, AHexTile* Goal)
|
||||
|
||||
while (iPathNode != Start) {
|
||||
Path.Emplace(iPathNode);
|
||||
|
||||
if (iPathNode->Distance(iPathNode->CameFrom) > 1) {
|
||||
bChainBroken = true;
|
||||
UE_LOG(LogTemp, Warning, TEXT("Chain is broken in LinkPath function..."));
|
||||
}
|
||||
|
||||
iPathNode = iPathNode->CameFrom;
|
||||
}
|
||||
|
||||
Algo::Reverse(Path);
|
||||
return Path;
|
||||
}
|
Reference in New Issue
Block a user