Core/PathGenerator: Fix path generator returning shortcuts when start and end are on the same polygon

Port From (https://github.com/TrinityCore/TrinityCore/commit/dd929665e564e01b5346844adb96d8fd0eb710c4)
This commit is contained in:
hondacrx
2022-01-06 00:02:56 -05:00
parent 3be49e6e3a
commit 5f81b80b8d
2 changed files with 4 additions and 9 deletions
+1 -1
View File
@@ -4922,7 +4922,7 @@ namespace Game.Spells
// first try with raycast, if it fails fall back to normal path
bool result = m_preGeneratedPath.CalculatePath(target.GetPositionX(), target.GetPositionY(), target.GetPositionZ(), false, false);
if (m_preGeneratedPath.GetPathType().HasAnyFlag(PathType.Short))
return SpellCastResult.OutOfRange;
return SpellCastResult.NoPath;
else if (!result || m_preGeneratedPath.GetPathType().HasAnyFlag(PathType.NoPath | PathType.Incomplete))
return SpellCastResult.NoPath;
else if (m_preGeneratedPath.IsInvalidDestinationZ(target)) // Check position z, if not in a straight line