Core/Spell: SPELL_EFFECT_PULL_TOWARDS correction (#24251)

* SPELL_EFFECT_PULL_TOWARDS correction

* Hi Appveyor

(cherry picked from commit b88881f8ad)
This commit is contained in:
NoName
2020-03-17 21:01:13 +02:00
committed by Shauren
parent 934c320d4b
commit cc1c67183f

View File

@@ -4002,12 +4002,15 @@ void Spell::EffectPullTowards()
if (!unitTarget)
return;
float speedXY = effectInfo->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));
unitTarget->GetMotionMaster()->MoveJump(pos, speedXY, speedZ);
// 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 = 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);
}
void Spell::EffectPullTowardsDest()