[9913] Fix TARGET_SCRIPT searcher and also look for objects that are Pet*

Pet (guardian, mini-pet) may also be the target of TARGET_SCRIPT, and are not considered a grid object.

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-05-16 09:29:12 +02:00
parent 6d5d8778fa
commit fab9a3ae96
2 changed files with 3 additions and 2 deletions

View file

@ -4491,7 +4491,8 @@ SpellCastResult Spell::CheckCast(bool strict)
MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*m_caster, i_spellST->second.targetEntry, i_spellST->second.type != SPELL_TARGET_TYPE_DEAD, range); MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*m_caster, i_spellST->second.targetEntry, i_spellST->second.type != SPELL_TARGET_TYPE_DEAD, range);
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(m_caster, p_Creature, u_check); MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(m_caster, p_Creature, u_check);
Cell::VisitGridObjects(m_caster, searcher, range); // Visit all, need to find also Pet* objects
Cell::VisitAllObjects(m_caster, searcher, range);
range = u_check.GetLastRange(); range = u_check.GetLastRange();
} }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "9912" #define REVISION_NR "9913"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__