Core/Objects: fixed random destination selection for spells casted by flying units
* the path generator will now check for realtime movement flags instead of movement template data for units
This commit is contained in:
1 parent
bc57ecd3bd
commit
d91fa5023e
2 files changed
+23
-19
No files matched your search
@@ -180,7 +180,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)
|
||||
@@ -234,7 +234,7 @@ void PathGenerator::BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 con
|
||||
TC_LOG_DEBUG("maps.mmaps", "++ BuildPolyPath :: flying case");
|
||||
if (const Unit* _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)
|
||||
|
||||
Reference in new issue
Block a user