aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2015-07-03 23:16:34 +0200
committerjackpoz <giacomopoz@gmail.com>2015-07-03 23:16:34 +0200
commita328a119784252c6d514436f4ceffa693ac65453 (patch)
tree1b4c02f1f1ea45845465be931fbccd80fda20520 /src
parent6680a7c331a4ee981b55d0d725997f0bc3523c3b (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Spell.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 00a28f22db4..30c02db9150 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -5088,12 +5088,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))