Core/Units: Update PlayHoverAnim state when flying or hovering
Port From (https://github.com/TrinityCore/TrinityCore/commit/c1b36eec5678090654dfd65a3fef29ea8ada6ef2)
This commit is contained in:
@@ -734,6 +734,16 @@ namespace Game.Entities
|
|||||||
SetAnimTier(AnimTier.Ground);
|
SetAnimTier(AnimTier.Ground);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IsAlive())
|
||||||
|
{
|
||||||
|
if (IsGravityDisabled() || IsHovering())
|
||||||
|
SetPlayHoverAnim(true);
|
||||||
|
else
|
||||||
|
SetPlayHoverAnim(false);
|
||||||
|
}
|
||||||
|
else if (IsPlayer()) // To update player who dies while flying/hovering
|
||||||
|
SetPlayHoverAnim(false, false);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1112,6 +1122,16 @@ namespace Game.Entities
|
|||||||
SetAnimTier(AnimTier.Ground);
|
SetAnimTier(AnimTier.Ground);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IsAlive())
|
||||||
|
{
|
||||||
|
if (IsGravityDisabled() || IsHovering())
|
||||||
|
SetPlayHoverAnim(true);
|
||||||
|
else
|
||||||
|
SetPlayHoverAnim(false);
|
||||||
|
}
|
||||||
|
else if (IsPlayer()) // To update player who dies while flying/hovering
|
||||||
|
SetPlayHoverAnim(false, false);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1661,10 +1681,16 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public bool IsPlayingHoverAnim() { return _playHoverAnim; }
|
public bool IsPlayingHoverAnim() { return _playHoverAnim; }
|
||||||
|
|
||||||
void SetPlayHoverAnim(bool enable)
|
void SetPlayHoverAnim(bool enable, bool sendUpdate = true)
|
||||||
{
|
{
|
||||||
|
if (IsPlayingHoverAnim() == enable)
|
||||||
|
return;
|
||||||
|
|
||||||
_playHoverAnim = enable;
|
_playHoverAnim = enable;
|
||||||
|
|
||||||
|
if (!sendUpdate)
|
||||||
|
return;
|
||||||
|
|
||||||
SetPlayHoverAnim data = new();
|
SetPlayHoverAnim data = new();
|
||||||
data.UnitGUID = GetGUID();
|
data.UnitGUID = GetGUID();
|
||||||
data.PlayHoverAnim = enable;
|
data.PlayHoverAnim = enable;
|
||||||
|
|||||||
Reference in New Issue
Block a user