mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-21 02:20:00 +01:00
[Movement] Fix path finder
This commit is contained in:
parent
98ff69473c
commit
f789f531b3
@ -1415,7 +1415,7 @@ const Movement::PointsArray MovementAction::SearchForBestPath(float x, float y,
|
|||||||
gen.CalculatePath(x, y, tempZ);
|
gen.CalculatePath(x, y, tempZ);
|
||||||
Movement::PointsArray result = gen.GetPath();
|
Movement::PointsArray result = gen.GetPath();
|
||||||
float min_length = gen.getPathLength();
|
float min_length = gen.getPathLength();
|
||||||
if (gen.GetPathType() == PATHFIND_NORMAL && abs(tempZ - z) < 0.5f) {
|
if ((gen.GetPathType() & PATHFIND_NORMAL) && abs(tempZ - z) < 0.5f) {
|
||||||
modified_z = tempZ;
|
modified_z = tempZ;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -1431,7 +1431,7 @@ const Movement::PointsArray MovementAction::SearchForBestPath(float x, float y,
|
|||||||
}
|
}
|
||||||
PathGenerator gen(bot);
|
PathGenerator gen(bot);
|
||||||
gen.CalculatePath(x, y, tempZ);
|
gen.CalculatePath(x, y, tempZ);
|
||||||
if (gen.GetPathType() & PATHFIND_NORMAL && gen.getPathLength() < min_length) {
|
if ((gen.GetPathType() & PATHFIND_NORMAL) && gen.getPathLength() < min_length) {
|
||||||
found = true;
|
found = true;
|
||||||
min_length = gen.getPathLength();
|
min_length = gen.getPathLength();
|
||||||
result = gen.GetPath();
|
result = gen.GetPath();
|
||||||
@ -1445,7 +1445,7 @@ const Movement::PointsArray MovementAction::SearchForBestPath(float x, float y,
|
|||||||
}
|
}
|
||||||
PathGenerator gen(bot);
|
PathGenerator gen(bot);
|
||||||
gen.CalculatePath(x, y, tempZ);
|
gen.CalculatePath(x, y, tempZ);
|
||||||
if (gen.GetPathType() & PATHFIND_NORMAL && gen.getPathLength() < min_length) {
|
if ((gen.GetPathType() & PATHFIND_NORMAL) && gen.getPathLength() < min_length) {
|
||||||
found = true;
|
found = true;
|
||||||
min_length = gen.getPathLength();
|
min_length = gen.getPathLength();
|
||||||
result = gen.GetPath();
|
result = gen.GetPath();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user