[12203] Improve EffectTeleUnitsFaceCaster and target-selection for position targets

* Let EffectTeleUnitsFaceCaster use a destination for teleporting if provided
* Expect to add caster for TARGET_RANDOM_NEARBY_LOC, TARGET_RANDOM_CIRCUMFERENCE_POINT only for summon spells (or similar spells)
This commit is contained in:
Schmoozerd 2012-09-08 23:12:55 +02:00 committed by Antz
parent 6ba3c19a22
commit d2679caf85
3 changed files with 12 additions and 5 deletions

View file

@ -5689,10 +5689,14 @@ void Spell::EffectTeleUnitsFaceCaster(SpellEffectEntry const* effect)
if (unitTarget->IsTaxiFlying())
return;
float dis = GetSpellRadius(sSpellRadiusStore.LookupEntry(effect->EffectRadiusIndex));
float fx, fy, fz;
m_caster->GetClosePoint(fx, fy, fz, unitTarget->GetObjectBoundingRadius(), dis);
if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)
m_targets.getDestination(fx, fy, fz);
else
{
float dis = GetSpellRadius(sSpellRadiusStore.LookupEntry(effect->EffectRadiusIndex));
m_caster->GetClosePoint(fx, fy, fz, unitTarget->GetObjectBoundingRadius(), dis);
}
unitTarget->NearTeleportTo(fx, fy, fz, -m_caster->GetOrientation(), unitTarget == m_caster);
}