mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
perf: Add path height correction on world load (#1178)
* Add path height correction on world load * Increase height because Nexus Tower is tall * Update height checker - Only go up and down, do not deviate from the point you are on - As a backup, use the nearestPoint on the nearestPoly, should detour be able to find one. - Add a debug assert to fail the program should toReturn differ from nearestPoint[1]. Update dNavMesh.cpp Update dNavMesh.cpp * Fix if condition to actually return the value... --------- Co-authored-by: Aaron Kimbrell <aronwk.aaron@gmail.com>
This commit is contained in:
@@ -3,4 +3,5 @@ set(DZONEMANAGER_SOURCES "dZoneManager.cpp"
|
||||
"Spawner.cpp"
|
||||
"Zone.cpp")
|
||||
|
||||
add_library(dZoneManager STATIC ${DZONEMANAGER_SOURCES})
|
||||
add_library(dZoneManager STATIC ${DZONEMANAGER_SOURCES})
|
||||
target_link_libraries(dZoneManager dPhysics)
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#include "CDZoneTableTable.h"
|
||||
#include "Spawner.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "dpWorld.h"
|
||||
|
||||
#include "eTriggerCommandType.h"
|
||||
#include "eTriggerEventType.h"
|
||||
@@ -554,6 +555,14 @@ void Zone::LoadPath(std::istream& file) {
|
||||
if (ldfConfig) waypoint.config.push_back(ldfConfig);
|
||||
}
|
||||
}
|
||||
// We verify the waypoint heights against the navmesh because in many movement paths,
|
||||
// the waypoint is located near 0 height,
|
||||
if (path.pathType == PathType::Movement) {
|
||||
if (dpWorld::Instance().IsLoaded()) {
|
||||
// 2000 should be large enough for every world.
|
||||
waypoint.position.y = dpWorld::Instance().GetNavMesh()->GetHeightAtPoint(waypoint.position, 2000.0f);
|
||||
}
|
||||
}
|
||||
path.pathWaypoints.push_back(waypoint);
|
||||
}
|
||||
m_Paths.push_back(path);
|
||||
|
Reference in New Issue
Block a user