Core/Units: flight and hover checks will now consider movement template data as well as manually set flight states

Port From (https://github.com/TrinityCore/TrinityCore/commit/294657f7dd4d2db1ca6dcf66f0b0895c6ba92949)
This commit is contained in:
hondacrx
2022-02-22 19:59:03 -05:00
parent 236f1d6999
commit bc52ff717a
4 changed files with 10 additions and 10 deletions
+4 -4
View File
@@ -2818,7 +2818,7 @@ namespace Game.Entities
bool CanNotReachTarget() { return m_cannotReachTarget; }
void SetCannotReachTarget(bool cannotReach)
public void SetCannotReachTarget(bool cannotReach)
{
if (cannotReach == m_cannotReachTarget)
return;
@@ -3101,9 +3101,9 @@ namespace Game.Entities
public bool CanWalk() { return GetMovementTemplate().IsGroundAllowed(); }
public override bool CanSwim() { return GetMovementTemplate().IsSwimAllowed() || IsPet();}
public override bool CanFly() { return GetMovementTemplate().IsFlightAllowed(); }
bool CanHover() { return GetMovementTemplate().Ground == CreatureGroundMovementType.Hover; }
public override bool CanFly() { return GetMovementTemplate().IsFlightAllowed() || IsFlying(); }
bool CanHover() { return GetMovementTemplate().Ground == CreatureGroundMovementType.Hover || IsHovering(); }
public bool IsDungeonBoss() { return (GetCreatureTemplate().FlagsExtra.HasAnyFlag(CreatureFlagsExtra.DungeonBoss)); }
public override bool IsAffectedByDiminishingReturns() { return base.IsAffectedByDiminishingReturns() || GetCreatureTemplate().FlagsExtra.HasAnyFlag(CreatureFlagsExtra.AllDiminish); }
+2 -2
View File
@@ -31,7 +31,7 @@ namespace Game.Entities
{
public partial class Unit
{
public bool IsLevitating()
public bool IsGravityDisabled()
{
return m_movementInfo.HasMovementFlag(MovementFlag.DisableGravity);
}
@@ -661,7 +661,7 @@ namespace Game.Entities
public bool SetDisableGravity(bool disable)
{
if (disable == IsLevitating())
if (disable == IsGravityDisabled())
return false;
if (disable)