aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNoName <322016+Faq@users.noreply.github.com>2020-03-17 21:01:13 +0200
committerGitHub <noreply@github.com>2020-03-17 20:01:13 +0100
commitb88881f8adc2448395f7487d398012094a06a64f (patch)
tree8e7091b23cee89145eacb15eb7de9e6760fb0133 /src
parent6fde051e4e52d98d1a6cf31b8ad3fcf95e0e83fd (diff)
Core/Spell: SPELL_EFFECT_PULL_TOWARDS correction (#24251)
* SPELL_EFFECT_PULL_TOWARDS correction * Hi Appveyor
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/SpellEffects.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index e000b26eeda..db1a80f2ddf 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -4392,12 +4392,15 @@ void Spell::EffectPullTowards(SpellEffIndex effIndex)
if (!unitTarget)
return;
- float speedXY = m_spellInfo->Effects[effIndex].MiscValue / 10.0f;
- float speedZ = damage / 10.0f;
- Position pos;
- pos.Relocate(m_caster);
+ Position pos = m_caster->GetFirstCollisionPosition(m_caster->GetCombatReach(), m_caster->GetRelativeAngle(unitTarget));
+
+ // This is a blizzlike mistake: this should be 2D distance according to projectile motion formulas, but Blizzard erroneously used 3D distance.
+ float distXY = unitTarget->GetExactDist(pos);
+ float distZ = pos.GetPositionZ() - unitTarget->GetPositionZ();
+ float speedXY = m_spellInfo->Effects[effIndex].MiscValue ? m_spellInfo->Effects[effIndex].MiscValue / 10.0f : 30.0f;
+ float speedZ = (2 * speedXY * speedXY * distZ + Movement::gravity * distXY * distXY) / (2 * speedXY * distXY);
- unitTarget->GetMotionMaster()->MoveJump(pos, speedXY, speedZ);
+ unitTarget->JumpTo(speedXY, speedZ, true, pos);
}
void Spell::EffectPullTowardsDest(SpellEffIndex effIndex)