[c12573] Improve target selection for TARGET_BEHIND_VICTIM

This commit is contained in:
Xfurry 2013-05-31 10:00:41 +01:00 committed by Antz
parent e241dd61ca
commit 3e2aefb538
2 changed files with 15 additions and 4 deletions

View file

@ -2664,11 +2664,12 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
pTarget = m_caster->getVictim();
else if (m_caster->GetTypeId() == TYPEID_PLAYER)
pTarget = ObjectAccessor::GetUnit(*m_caster, ((Player*)m_caster)->GetSelectionGuid());
else if (m_targets.getUnitTarget())
pTarget = m_caster;
if (pTarget)
{
float angle = 0.0f;
float dist = (radius && targetMode != TARGET_BEHIND_VICTIM) ? radius : CONTACT_DISTANCE;
switch (targetMode)
{
@ -2679,7 +2680,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
}
float _target_x, _target_y, _target_z;
pTarget->GetClosePoint(_target_x, _target_y, _target_z, pTarget->GetObjectBoundingRadius(), dist, angle);
pTarget->GetClosePoint(_target_x, _target_y, _target_z, pTarget->GetObjectBoundingRadius(), radius, angle);
if (pTarget->IsWithinLOS(_target_x, _target_y, _target_z))
{
targetUnitMap.push_back(m_caster);
@ -8144,6 +8145,16 @@ void Spell::GetSpellRangeAndRadius(SpellEffectEntry const* spellEffect, float& r
}
break;
}
case SPELLFAMILY_DRUID:
{
switch (m_spellInfo->Id)
{
case 49376: // Feral Charge - Cat
// No default radius for this spell, so we need to use the contact distance
radius = CONTACT_DISTANCE;
break;
}
}
default:
break;
}

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12572"
#define REVISION_NR "12573"
#endif // __REVISION_NR_H__