Core/Spells: fix charge and chargedest effect through textures

This commit is contained in:
Wilds
2011-12-10 01:43:04 +01:00
parent 196159dbcf
commit 65e8ff16ad

View File

@@ -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);
}
}