--HG--
branch : trunk
This commit is contained in:
megamage
2009-01-16 22:59:24 -06:00
12 changed files with 146 additions and 67 deletions
+6 -7
View File
@@ -1671,16 +1671,15 @@ bool Creature::FallGround()
if (getDeathState() == DEAD_FALLING)
return false;
// Let's do with no vmap because no way to get far distance with vmap high call
float tz = GetMap()->GetHeight(GetPositionX(), GetPositionY(), GetPositionZ(), false);
// Abort too if the ground is very near
if (fabs(GetPositionZ() - tz) < 0.1f)
float x, y, z;
GetPosition(x, y, z);
float ground_Z = GetMap()->GetVmapHeight(x, y, z, true);
if (fabs(ground_Z - z) < 0.1f)
return false;
Unit::setDeathState(DEAD_FALLING);
GetMotionMaster()->MovePoint(0, GetPositionX(), GetPositionY(), tz);
Relocate(GetPositionX(), GetPositionY(), tz);
GetMotionMaster()->MovePoint(0, x, y, ground_Z);
Relocate(x, y, ground_Z);
return true;
}