mirror of
https://github.com/mangosfour/server.git
synced 2025-12-28 13:37:13 +00:00
[10272] Add option for search distance to getHeight() functions and make Creature::FallGround() use VMaps properly.
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. Default height search is untouched, needs more research on how creature AI etc. will be affected.
This commit is contained in:
parent
747d1ebdcf
commit
730b4deaaf
10 changed files with 18 additions and 26 deletions
|
|
@ -234,7 +234,7 @@ namespace VMAP
|
|||
get height or INVALID_HEIGHT if no height available
|
||||
*/
|
||||
|
||||
float VMapManager2::getHeight(unsigned int pMapId, float x, float y, float z)
|
||||
float VMapManager2::getHeight(unsigned int pMapId, float x, float y, float z, float maxSearchDist)
|
||||
{
|
||||
float height = VMAP_INVALID_HEIGHT_VALUE; //no height
|
||||
if (isHeightCalcEnabled())
|
||||
|
|
@ -243,7 +243,7 @@ namespace VMAP
|
|||
if (instanceTree != iInstanceMapTrees.end())
|
||||
{
|
||||
Vector3 pos = convertPositionToInternalRep(x,y,z);
|
||||
height = instanceTree->second->getHeight(pos);
|
||||
height = instanceTree->second->getHeight(pos, maxSearchDist);
|
||||
if (!(height < G3D::inf()))
|
||||
{
|
||||
height = VMAP_INVALID_HEIGHT_VALUE; //no height
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue