From 3b22c59bece26bcbe3dde164e534a8e2c27042a7 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Sat, 25 Nov 2017 01:57:43 +0000 Subject: [PATCH] Fixed path error for charge spells after 17802ab6e5135f0220efcd8f4e460f8202a4c047 thanks @jackpoz for original patch --- src/game/Spells/Spell.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/Spells/Spell.cpp b/src/game/Spells/Spell.cpp index 28fed7f77..59beb5044 100644 --- a/src/game/Spells/Spell.cpp +++ b/src/game/Spells/Spell.cpp @@ -5804,7 +5804,8 @@ SpellCastResult Spell::CheckCast(bool strict) break; m_pathFinder = new PathGenerator(m_caster); - m_pathFinder->CalculatePath(pos.m_positionX, pos.m_positionY, pos.m_positionZ+0.15f, false); + float targetObjectSize = std::min(target->GetObjectSize(), 4.0f); + m_pathFinder->CalculatePath(pos.m_positionX, pos.m_positionY, pos.m_positionZ + targetObjectSize, false); G3D::Vector3 endPos = m_pathFinder->GetEndPosition(); // also check distance between target and the point calculated by mmaps if (m_pathFinder->GetPathType() & (PATHFIND_NOPATH | PATHFIND_INCOMPLETE) || target->GetExactDistSq(endPos.x, endPos.y, endPos.z) > maxdist*maxdist || m_pathFinder->getPathLength() > (40.0f + (m_caster->HasAura(58097) ? 5.0f : 0.0f))) return SPELL_FAILED_NOPATH;