From 7cabfc74205a6a74365a5e12f34da5838adec2cd Mon Sep 17 00:00:00 2001 From: jackpoz Date: Fri, 3 Jul 2015 23:16:34 +0200 Subject: Core/Spells: Fix Charge "no path" error with huge targets Fix Charge returning "no path found" error when targeting targets with Object Size of 8 like Festergut by changing how the target Z coordinate is set, using only half object size. It is unclear why the CalculatePath() call in Charge handler is using target object size, maybe for corner cases where the target is slightly below the ground. (cherry picked from commit a328a119784252c6d514436f4ceffa693ac65453) --- src/server/game/Spells/Spell.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 3b0da910b43..0bd632eb9f6 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5160,12 +5160,12 @@ SpellCastResult Spell::CheckCast(bool strict) 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() + target->GetObjectSize(), false, true); + bool result = m_preGeneratedPath.CalculatePath(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ() + target->GetObjectSize() / 2.f, false, true); if (m_preGeneratedPath.GetPathType() & PATHFIND_SHORT) return SPELL_FAILED_OUT_OF_RANGE; else if (!result || m_preGeneratedPath.GetPathType() & (PATHFIND_NOPATH | PATHFIND_INCOMPLETE)) { - result = m_preGeneratedPath.CalculatePath(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ() + target->GetObjectSize(), false, false); + result = m_preGeneratedPath.CalculatePath(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ() + target->GetObjectSize() / 2.f, false, false); if (m_preGeneratedPath.GetPathType() & PATHFIND_SHORT) return SPELL_FAILED_OUT_OF_RANGE; else if (!result || m_preGeneratedPath.GetPathType() & (PATHFIND_NOPATH | PATHFIND_INCOMPLETE)) -- cgit v1.2.3