aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Spell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rw-r--r--src/server/game/Spells/Spell.cpp18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 537a5971a32..60e09ef0753 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -1356,21 +1356,7 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici
Position pos = dest._position;
unitCaster->MovePositionToFirstCollision(pos, dist, angle);
- // Generate path to that point.
- if (!m_preGeneratedPath)
- m_preGeneratedPath = std::make_unique<PathGenerator>(unitCaster);
-
- m_preGeneratedPath->SetPathLengthLimit(dist);
-
- // Should we use straightline here ? What do we do when we don't have a full path ?
- bool pathResult = m_preGeneratedPath->CalculatePath(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), false, true);
- if (pathResult && m_preGeneratedPath->GetPathType() & (PATHFIND_NORMAL | PATHFIND_SHORTCUT))
- {
- pos.m_positionX = m_preGeneratedPath->GetActualEndPosition().x;
- pos.m_positionY = m_preGeneratedPath->GetActualEndPosition().y;
- pos.m_positionZ = m_preGeneratedPath->GetActualEndPosition().z;
- dest.Relocate(pos);
- }
+ dest.Relocate(pos);
break;
}
default:
@@ -5537,7 +5523,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint
m_preGeneratedPath->SetPathLengthLimit(range);
// 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);
+ bool result = m_preGeneratedPath->CalculatePath(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), false);
if (m_preGeneratedPath->GetPathType() & PATHFIND_SHORT)
return SPELL_FAILED_NOPATH;
else if (!result || m_preGeneratedPath->GetPathType() & (PATHFIND_NOPATH | PATHFIND_INCOMPLETE))