mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 22:37:02 +00:00
[9850] Fixed target selection for area spells casted from aura at enemy.
* Spell::GetCastingObject must be use for selection visual/point cast, not for friend/enemy checks. Add extanded GetAffectiveCasterObject for proper provide for referecned checks wild gameobject casted case. * Also support chain damage spells casted by gameobjects.
This commit is contained in:
parent
d1130af777
commit
921b0d668f
4 changed files with 29 additions and 15 deletions
|
|
@ -1660,7 +1660,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
|||
else
|
||||
{
|
||||
Unit* pUnitTarget = m_targets.getUnitTarget();
|
||||
Unit* originalCaster = GetAffectiveCaster();
|
||||
WorldObject* originalCaster = GetAffectiveCasterObject();
|
||||
if(!pUnitTarget || !originalCaster)
|
||||
break;
|
||||
|
||||
|
|
@ -6486,6 +6486,16 @@ void Spell::FillRaidOrPartyHealthPriorityTargets(UnitList &targetUnitMap, Unit*
|
|||
}
|
||||
}
|
||||
|
||||
WorldObject* Spell::GetAffectiveCasterObject() const
|
||||
{
|
||||
if (m_originalCasterGUID.IsEmpty())
|
||||
return m_caster;
|
||||
|
||||
if (m_originalCasterGUID.IsGameobject() && m_caster->IsInWorld())
|
||||
return m_caster->GetMap()->GetGameObject(m_originalCasterGUID);
|
||||
return m_originalCaster;
|
||||
}
|
||||
|
||||
WorldObject* Spell::GetCastingObject() const
|
||||
{
|
||||
if (m_originalCasterGUID.IsGameobject())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue