Core/Creatures: Remove hover on death

Port From (https://github.com/TrinityCore/TrinityCore/commit/a91edcb9524b53f027a8ef8c247a443a9bb42f1e)
This commit is contained in:
hondacrx
2021-08-24 12:27:36 -04:00
parent e4240fcd94
commit 8636712938
4 changed files with 18 additions and 12 deletions
+5 -2
View File
@@ -1824,7 +1824,10 @@ namespace Game.Entities
if (m_formation != null && m_formation.GetLeader() == this)
m_formation.FormationReset(true);
if ((CanFly() || IsFlying()))
bool needsFalling = IsFlying() || IsHovering();
SetHover(false);
if (needsFalling)
GetMotionMaster().MoveFall();
base.SetDeathState(DeathState.Corpse);
@@ -2848,7 +2851,7 @@ namespace Game.Entities
{
SetCanFly(false);
SetDisableGravity(false);
if (CanHover() || HasAuraType(AuraType.Hover))
if (IsAlive() && (CanHover() || HasAuraType(AuraType.Hover)))
SetHover(true);
}
@@ -362,12 +362,10 @@ namespace Game.Entities
Rooted = false;
}
bool IsGroundAllowed() { return Ground != CreatureGroundMovementType.None; }
bool IsSwimAllowed() { return Swim; }
bool IsFlightAllowed() { return Flight != CreatureFlightMovementType.None; }
bool IsRooted() { return Rooted; }
public bool IsGroundAllowed() { return Ground != CreatureGroundMovementType.None; }
public bool IsSwimAllowed() { return Swim; }
public bool IsFlightAllowed() { return Flight != CreatureFlightMovementType.None; }
public bool IsRooted() { return Rooted; }
public override string ToString()
{
+3 -1
View File
@@ -989,7 +989,9 @@ namespace Game.Entities
else
{
RemoveUnitMovementFlag(MovementFlag.Hover);
if (hoverHeight != 0)
//! Dying creatures will MoveFall from setDeathState
if (hoverHeight != 0 && (!IsDying() || !IsUnit()))
{
float newZ = GetPositionZ() - hoverHeight;
UpdateAllowedPositionZ(GetPositionX(), GetPositionY(), ref newZ);