aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.cpp
diff options
context:
space:
mode:
authormaximius <none@none>2009-09-25 19:20:04 -0700
committermaximius <none@none>2009-09-25 19:20:04 -0700
commit2853aa1cd1bb3026d697672aefb6eace902f90b1 (patch)
tree9507ef4b5de46038f650eda146b126739820d19e /src/game/Player.cpp
parent0febe02227f5ac2272ff1e57c6b527300ffe6641 (diff)
*Grobbulus - in Inject event, tank is not a target for this spell, by Gyullo
*Gundrak - AI for the boss Moorabi, by Manuel *Improvements to player death handling (they will now fall to the ground).. also attempted to improve creature death handling the same way. --HG-- branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r--src/game/Player.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 9a6ebb558fe..5a342306174 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -4442,8 +4442,27 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
}
}
+bool Player::FallGround(bool noDeath/* = false*/)
+{
+ // Let's abort after we called this function one time
+ if (getDeathState() == DEAD_FALLING && !noDeath)
+ return false;
+
+ 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;
+
+ GetMotionMaster()->MoveFall(ground_Z, EVENT_FALL_GROUND);
+ if(!noDeath) Unit::setDeathState(DEAD_FALLING);
+ return true;
+}
+
void Player::KillPlayer()
{
+ if(IsFlying()) FallGround();
+
SetMovement(MOVE_ROOT);
StopMirrorTimers(); //disable timers(bars)