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:
click
2010-07-27 17:29:33 +02:00
parent dbd76ef9ed
commit e5b7f6ad01
9 changed files with 14 additions and 21 deletions
@@ -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;