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:
@@ -1540,7 +1540,8 @@ bool Creature::FallGround()
|
||||
|
||||
float x, y, z;
|
||||
GetPosition(x, y, z);
|
||||
float ground_Z = GetMap()->GetHeight(x, y, z);
|
||||
// use larger distance for vmap height search than in most other cases
|
||||
float ground_Z = GetMap()->GetHeight(x, y, z, true, MAX_FALL_DISTANCE);
|
||||
if (fabs(ground_Z - z) < 0.1f)
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user