Pathing underwater works a lot better now.

This commit is contained in:
KimLS
2016-01-18 15:22:17 -08:00
parent a6a06de994
commit 978650eb1f
5 changed files with 86 additions and 24 deletions
+12 -1
View File
@@ -5626,7 +5626,18 @@ void Client::Handle_OP_FindPersonRequest(const EQApplicationPacket *app)
}
glm::vec3 dest(target->GetX(), target->GetY(), target->GetZ());
auto route = zone->pathing.FindRoute(glm::vec3(GetX(), GetY(), GetZ()), dest);
glm::vec3 src(GetX(), GetY(), GetZ());
if (zone->HasMap()) {
auto best_z_src = zone->zonemap->FindBestZ(src, nullptr);
if (best_z_src != BEST_Z_INVALID) {
src.z = best_z_src;
}
auto best_z_dest = zone->zonemap->FindBestZ(dest, nullptr);
if (best_z_dest != BEST_Z_INVALID) {
dest.z = best_z_dest;
}
}
auto route = zone->pathing.FindRoute(src, dest);
CreatePathFromRoute(dest, route);
}
}