aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOvah <dreadkiller@gmx.de>2020-03-29 21:23:53 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-31 00:55:12 +0100
commitfb7a60d49d1b545e09274e396e3f740359295c23 (patch)
treef3d2d3506b3e7562fffdccbedbd930c13f3f18ff /src
parent5cde08e6e81af063ce4134bf1de6a5ea83b1733a (diff)
Core/Spells: fixed a possible client crash when casting pull towards dest spells with misc value 0 (#24365)
* This case is not happening in 335 yet as it barely has any spell with pull towardst dest effects. However, this is very well present in 4.x and beyond so let's add it for future cherrypicks (cherry picked from commit 61aec37b4ffd5fbd0bdde4de1cf7313d578651a7)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/SpellEffects.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 2785194768d..82f615d07b4 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -4036,7 +4036,7 @@ void Spell::EffectPullTowardsDest()
float distXY = unitTarget->GetExactDist(pos);
float distZ = pos->GetPositionZ() - unitTarget->GetPositionZ();
- float speedXY = effectInfo->MiscValue / 10.0f;
+ float speedXY = effectInfo->MiscValue ? effectInfo->MiscValue / 10.0f : 30.0f;
float speedZ = (2 * speedXY * speedXY * distZ + Movement::gravity * distXY * distXY) / (2 * speedXY * distXY);
unitTarget->JumpTo(speedXY, speedZ, true, *pos);