mirror of
https://github.com/mangosfour/server.git
synced 2025-12-21 01:37:05 +00:00
[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:
parent
ef8789f780
commit
225b4db1ca
5 changed files with 62 additions and 178 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue