aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2015-07-28 21:11:55 +0200
committerCarbenium <carbenium@outlook.com>2015-09-24 19:28:00 +0200
commit8a5d92726a0b52b70e881c595a2a8e1000d9de68 (patch)
tree77d5dd0d5876a710cf0a35ed3c63946e661ce416 /src
parentcde1141fb45433ad867fbfa4f9b2818f57bf101d (diff)
Core/Spells: Fix Charge "no path" error with even bigger targets
Addition to a328a119784252c6d514436f4ceffa693ac65453 , clamp object size to [0,4] in case of very huge Creatures like Lord Marrowgar entry 36612 (cherry picked from commit 0a94382637ba9212a23e224b4ac2df114acb4ca7)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Spell.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 750c3d347ed..7bdd33a74b2 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -5131,12 +5131,13 @@ 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() / 2.f, false, true);
+ float targetObjectSize = std::min(target->GetObjectSize(), 4.0f);
+ bool result = m_preGeneratedPath.CalculatePath(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ() + targetObjectSize, 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() / 2.f, false, false);
+ result = m_preGeneratedPath.CalculatePath(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ() + targetObjectSize, false, false);
if (m_preGeneratedPath.GetPathType() & PATHFIND_SHORT)
return SPELL_FAILED_OUT_OF_RANGE;
else if (!result || m_preGeneratedPath.GetPathType() & (PATHFIND_NOPATH | PATHFIND_INCOMPLETE))