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
@@ -169,7 +169,7 @@ namespace Game.Movement
{
Log.outDebug(LogFilter.Maps, "++ BuildPolyPath . (startPoly == 0 || endPoly == 0)\n");
BuildShortcut();
bool path = _source.IsTypeId(TypeId.Unit) && _source.ToCreature().IsFlying();
bool path = _source.IsTypeId(TypeId.Unit) && _source.ToCreature().CanFly();
bool waterPath = _source.IsTypeId(TypeId.Unit) && _source.ToCreature().CanSwim();
if (waterPath)
@@ -224,7 +224,7 @@ namespace Game.Movement
Unit _sourceUnit = _source.ToUnit();
if (_sourceUnit != null)
{
if (_sourceUnit.IsFlying())
if (_sourceUnit.CanFly())
buildShotrcut = true;
// Allow to build a shortcut if the unit is falling and it's trying to move downwards towards a target (i.e. charging)
else if (_sourceUnit.IsFalling() && endPos.Z < startPos.Z)