From 0c15b2ac7cd8f57004b009a99ec357ef2eefecb3 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Sat, 16 May 2020 17:40:08 +0200 Subject: Core/Objects: fixed destination calculation for destination based spells casted by flying units * Additionally he PathGenerator will now check for realtime movement flags instead of creature based template data only so scripted flying movement and players will now correctly get their path calculated (cherry picked from commit fdcb7388a64bf61a691535933a9fbae0504b80cc) --- src/server/game/Movement/PathGenerator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server/game/Movement') diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index 77d59afdbad..0effe2a5d87 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -179,7 +179,7 @@ void PathGenerator::BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 con { TC_LOG_DEBUG("maps.mmaps", "++ BuildPolyPath :: (startPoly == 0 || endPoly == 0)"); BuildShortcut(); - bool path = _source->GetTypeId() == TYPEID_UNIT && _source->ToCreature()->CanFly(); + bool path = _source->GetTypeId() == TYPEID_UNIT && _source->ToCreature()->IsFlying(); bool waterPath = _source->GetTypeId() == TYPEID_UNIT && _source->ToCreature()->CanSwim(); if (waterPath) @@ -233,7 +233,7 @@ void PathGenerator::BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 con TC_LOG_DEBUG("maps.mmaps", "++ BuildPolyPath :: flying case"); if (Unit const* _sourceUnit = _source->ToUnit()) { - if (_sourceUnit->CanFly()) + if (_sourceUnit->IsFlying()) 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) -- cgit v1.2.3