mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-25 03:12:09 +01:00
Add option for search distance to getHeight() functions and make Creature::FallGround() use VMaps properly. (Fix by Lynx3d)
This finally prevents flying creatures from falling to infinity (basically instantly diappearing) in several instances, aswell as prevent creatures from falling inside larger solid object around the world. --HG-- branch : trunk
This commit is contained in:
@@ -224,12 +224,12 @@ namespace VMAP
|
||||
|
||||
//=========================================================
|
||||
|
||||
float StaticMapTree::getHeight(const Vector3& pPos) const
|
||||
float StaticMapTree::getHeight(const Vector3& pPos, float maxSearchDist) const
|
||||
{
|
||||
float height = G3D::inf();
|
||||
Vector3 dir = Vector3(0,0,-1);
|
||||
G3D::Ray ray(pPos, dir); // direction with length of 1
|
||||
float maxDist = VMapDefinitions::getMaxCanFallDistance();
|
||||
float maxDist = maxSearchDist;
|
||||
if (getIntersectionTime(ray, maxDist, false))
|
||||
{
|
||||
height = pPos.z - maxDist;
|
||||
|
||||
Reference in New Issue
Block a user