From c96f5f9a8fdce84a298f8419025b235a40cc09b2 Mon Sep 17 00:00:00 2001 From: gvcoman Date: Sat, 22 Nov 2008 00:49:45 -0500 Subject: Added more calls for searching the world object containers for spell scripted targets. --HG-- branch : trunk --- src/game/Spell.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/game/Spell.cpp') diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 3d15278bcb8..0c1f25964a9 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1308,7 +1308,9 @@ Unit* Spell::SearchNearbyTarget(float radius, SpellTargets TargetType, uint32 en Creature* target = NULL; Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*m_caster, entry, true, radius); Trinity::CreatureLastSearcher searcher(target, u_check); + TypeContainerVisitor, WorldTypeMapContainer > world_unit_searcher(searcher); TypeContainerVisitor, GridTypeMapContainer > grid_unit_searcher(searcher); + cell_lock->Visit(cell_lock, world_unit_searcher, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster)); cell_lock->Visit(cell_lock, grid_unit_searcher, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster)); return target; }break; @@ -1602,9 +1604,11 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list &TagUnitMap) Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*m_caster,i_spellST->second.targetEntry,i_spellST->second.type!=SPELL_TARGET_TYPE_DEAD,range); Trinity::CreatureLastSearcher searcher(p_Creature, u_check); + TypeContainerVisitor, WorldTypeMapContainer > world_creature_searcher(searcher); TypeContainerVisitor, GridTypeMapContainer > grid_creature_searcher(searcher); CellLock cell_lock(cell, p); + cell_lock->Visit(cell_lock, world_creature_searcher, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster)); cell_lock->Visit(cell_lock, grid_creature_searcher, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster)); if(p_Creature ) -- cgit v1.2.3