[11068] Prevent infinity creature fall at fail get heght.

Also fix wrong use INVALID_HEIGHT as height value.
It must be used only for _check_ height, and DON'T must use as real height value.
Must fix some wrong height check results.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
mns 2011-01-25 01:15:37 +03:00 committed by VladimirMangos
parent 21cc7cd179
commit d699d0973b
4 changed files with 9 additions and 7 deletions

View file

@ -1464,10 +1464,11 @@ bool Creature::FallGround()
// use larger distance for vmap height search than in most other cases
float tz = GetTerrain()->GetHeight(GetPositionX(), GetPositionY(), GetPositionZ(), true, MAX_FALL_DISTANCE);
if (tz < INVALID_HEIGHT)
if (tz <= INVALID_HEIGHT)
{
DEBUG_LOG("FallGround: creature %u at map %u (x: %f, y: %f, z: %f), not able to retrive a proper GetHeight (z: %f).",
GetEntry(), GetMap()->GetId(), GetPositionX(), GetPositionX(), GetPositionZ(), tz);
return false;
}
// Abort too if the ground is very near