mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[c12573] Improve target selection for TARGET_BEHIND_VICTIM
This commit is contained in:
parent
e241dd61ca
commit
3e2aefb538
2 changed files with 15 additions and 4 deletions
|
|
@ -2664,22 +2664,23 @@ 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)
|
||||
{
|
||||
case TARGET_INFRONT_OF_VICTIM: break;
|
||||
case TARGET_INFRONT_OF_VICTIM: break;
|
||||
case TARGET_BEHIND_VICTIM: angle = M_PI_F; break;
|
||||
case TARGET_RIGHT_FROM_VICTIM: angle = -M_PI_F / 2; break;
|
||||
case TARGET_LEFT_FROM_VICTIM: angle = M_PI_F / 2; break;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "12572"
|
||||
#define REVISION_NR "12573"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue