mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 19:06:49 +01:00
Core/Spells: fix charge and chargedest effect through textures
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user