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:
1 parent
dbd76ef9ed
commit
e5b7f6ad01
9 files changed
+14
-21
No files matched your search
@@ -1680,7 +1680,7 @@ inline GridMap *Map::GetGrid(float x, float y)
|
||||
return GridMaps[gx][gy];
|
||||
}
|
||||
|
||||
float Map::GetHeight(float x, float y, float z, bool pUseVmaps) const
|
||||
float Map::GetHeight(float x, float y, float z, bool pUseVmaps, float maxSearchDist) const
|
||||
{
|
||||
// find raw .map surface under Z coordinates
|
||||
float mapHeight;
|
||||
@@ -1704,7 +1704,7 @@ float Map::GetHeight(float x, float y, float z, bool pUseVmaps) const
|
||||
if (vmgr->isHeightCalcEnabled())
|
||||
{
|
||||
// look from a bit higher pos to find the floor
|
||||
vmapHeight = vmgr->getHeight(GetId(), x, y, z + 2.0f);
|
||||
vmapHeight = vmgr->getHeight(GetId(), x, y, z + 2.0f, maxSearchDist);
|
||||
}
|
||||
else
|
||||
vmapHeight = VMAP_INVALID_HEIGHT_VALUE;
|
||||
|
||||
Reference in new issue
Block a user