[10681] Added new Cell::Visit* functions to visit grids with center in (x,y) coords

* This fixes possible problems with Spell::FillAreaTargets(center of search should be (x,y) position, not spell caster's position)
* Cleanup Cell class, removed old and unused code
This commit is contained in:
SilverIce 2010-11-04 21:45:49 +02:00
parent ef8789f780
commit 225b4db1ca
5 changed files with 62 additions and 178 deletions

View file

@ -6623,15 +6623,8 @@ SpellCastResult Spell::CanOpenLock(SpellEffectIndex effIndex, uint32 lockId, Ski
*/
void Spell::FillAreaTargets(UnitList &targetUnitMap, float x, float y, float radius, SpellNotifyPushType pushType, SpellTargets spellTargets, WorldObject* originalCaster /*=NULL*/)
{
CellPair p(MaNGOS::ComputeCellPair(x, y));
Cell cell(p);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
MaNGOS::SpellNotifierCreatureAndPlayer notifier(*this, targetUnitMap, radius, pushType, spellTargets, originalCaster);
TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, WorldTypeMapContainer > world_notifier(notifier);
TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, GridTypeMapContainer > grid_notifier(notifier);
cell.Visit(p, world_notifier, *m_caster->GetMap(), *m_caster, radius);
cell.Visit(p, grid_notifier, *m_caster->GetMap(), *m_caster, radius);
Cell::VisitAllObjects(x, y, m_caster->GetMap(), notifier, radius);
}
void Spell::FillRaidOrPartyTargets(UnitList &targetUnitMap, Unit* member, Unit* center, float radius, bool raid, bool withPets, bool withcaster)