Fixed usage of 2D vector array

This commit is contained in:
smallmodel 2023-11-14 01:07:23 +01:00
parent d29454b44d
commit 096692fec8
No known key found for this signature in database
GPG key ID: A96F163ED4891440

View file

@ -167,7 +167,7 @@ PathInfo *PathSearch::GeneratePath(PathInfo *path)
VectorCopy2D(path_startdir, current_path->dir);
current_path->dist = Node->g;
} else {
VectorCopy(path_totaldir, current_path->dir);
VectorCopy2D(path_totaldir, current_path->dir);
path->dist = Node->h;
}
@ -754,7 +754,7 @@ int PathSearch::FindPathAway(
VectorSub2D(pathway->pos2, avoid, dir);
NewNode->h = VectorNormalize2D(dir);
NewNode->h += fBias - DotProduct(dir, vPreferredDir);
NewNode->h += fBias - DotProduct2D(dir, vPreferredDir);
f = (int)((float)g + NewNode->h);