diff options
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r-- | src/game/Spell.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index ac9eb8f5593..d23491f9d68 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2197,7 +2197,36 @@ void Spell::SetTargetMap(uint32 i, uint32 cur) break; case TARGET_OBJECT_AREA_SRC: // fix me case TARGET_OBJECT_AREA_DST: + { + float x, y, z; + if(cur == TARGET_OBJECT_AREA_SRC) + { + if(m_targets.HasSrc()) + { + x = m_targets.m_srcX; + y = m_targets.m_srcY; + z = m_targets.m_srcZ; + } + else + break; + } + else if(m_targets.HasDst()) + { + x = m_targets.m_destX; + y = m_targets.m_destY; + z = m_targets.m_destZ; + } + else + break; + + Trinity::GameObjectInRangeCheck check(x, y, z, radius + 50); + std::list<GameObject*> goList; + Trinity::GameObjectListSearcher<Trinity::GameObjectInRangeCheck> searcher(m_caster, goList, check); + m_caster->GetMap()->VisitGrid(x, y, radius, searcher); + for(std::list<GameObject*>::iterator itr = goList.begin(); itr != goList.end(); ++itr) + AddGOTarget(*itr, i); break; + } case TARGET_UNIT_PARTY_TARGET: m_targets.getUnitTarget()->GetPartyMember(unitList, radius); break; |