diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Spells/SpellEffects.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 4eb514c5869..034e38916ef 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -6226,9 +6226,13 @@ void Spell::EffectCharge(SpellEffIndex /*effIndex*/) if (!unitTarget) return; - float x, y, z; - unitTarget->GetContactPoint(m_caster, x, y, z); - m_caster->GetMotionMaster()->MoveCharge(x, y, z); + float angle = unitTarget->GetRelativeAngle(m_caster); + Position pos; + + unitTarget->GetContactPoint(m_caster, pos.m_positionX, pos.m_positionY, pos.m_positionZ); + unitTarget->GetFirstCollisionPosition(pos, unitTarget->GetObjectSize(), angle); + + m_caster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ + unitTarget->GetObjectSize()); } if (effectHandleMode == SPELL_EFFECT_HANDLE_HIT_TARGET) @@ -6249,9 +6253,13 @@ void Spell::EffectChargeDest(SpellEffIndex /*effIndex*/) if (m_targets.HasDst()) { - float x, y, z; - m_targets.GetDst()->GetPosition(x, y, z); - m_caster->GetMotionMaster()->MoveCharge(x, y, z); + Position pos; + m_targets.GetDst()->GetPosition(&pos); + float angle = m_caster->GetRelativeAngle(pos.GetPositionX(), pos.GetPositionY()); + float dist = m_caster->GetDistance(pos); + m_caster->GetFirstCollisionPosition(pos, dist, angle); + + m_caster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ); } } |