aboutsummaryrefslogtreecommitdiff
path: root/src/game/Creature.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Creature.cpp')
-rw-r--r--src/game/Creature.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index ad8d01aeca0..8745d86caa9 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -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;
}