aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Spell.cpp
diff options
context:
space:
mode:
authorGiacomo Pozzoni <giacomopoz@gmail.com>2020-01-09 19:38:45 +0100
committerShauren <shauren.trinity@gmail.com>2021-12-20 20:35:37 +0100
commitdd929665e564e01b5346844adb96d8fd0eb710c4 (patch)
tree7dd195d37d2902bec87823b13910db349a8911d7 /src/server/game/Spells/Spell.cpp
parentfd265269720e64bf39dae205b670b25a677a3938 (diff)
Core/PathGenerator: Fix path generator returning shortcuts when start and end are on the same polygon (#24036)
* Core/PathGenerator: Fix path generator returning shortcuts when start and end are on the same polygon Fix path generator returning shortcuts when start and end are on the same polygon by handling this case as if start and end were on 2 different polygons. This will ensure BuildPointPath() gets called which calls FindSmoothPath(), making sure each step is not longer than SMOOTH_PATH_STEP_SIZE (4 yards) * Change ingame cast error message to SPELL_FAILED_NOPATH from SPELL_FAILED_OUT_OF_RANGE if the generated path is too long (cherry picked from commit 29bf280e3496cf13c24ccb20e37da29d3bfa74d9)
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rw-r--r--src/server/game/Spells/Spell.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 38b81819ffc..69a8488d2b3 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -5683,7 +5683,7 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32
// 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);
if (m_preGeneratedPath->GetPathType() & PATHFIND_SHORT)
- return SPELL_FAILED_OUT_OF_RANGE;
+ return SPELL_FAILED_NOPATH;
else if (!result || m_preGeneratedPath->GetPathType() & (PATHFIND_NOPATH | PATHFIND_INCOMPLETE))
return SPELL_FAILED_NOPATH;
else if (m_preGeneratedPath->IsInvalidDestinationZ(target)) // Check position z, if not in a straight line