diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Grids/Notifiers/GridNotifiers.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index e623b98a13a..bb2a9c5130b 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -927,13 +927,15 @@ namespace Trinity { public: AnyAoETargetUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range) - : i_obj(obj), i_funit(funit), i_range(range) + : i_obj(obj), i_funit(funit), _spellInfo(NULL), i_range(range) { Unit const* check = i_funit; Unit const* owner = i_funit->GetOwner(); if (owner) check = owner; i_targetForPlayer = (check->GetTypeId() == TYPEID_PLAYER); + if (i_obj->GetTypeId() == TYPEID_DYNAMICOBJECT) + _spellInfo = sSpellMgr->GetSpellInfo(((DynamicObject*)i_obj)->GetSpellId()); } bool operator()(Unit* u) { @@ -941,7 +943,7 @@ namespace Trinity if (u->GetTypeId() == TYPEID_UNIT && ((Creature*)u)->isTotem()) return false; - if (i_funit->IsValidAttackTarget(u) && i_obj->IsWithinDistInMap(u, i_range)) + if (i_funit->_IsValidAttackTarget(u, _spellInfo) && i_obj->IsWithinDistInMap(u, i_range)) return true; return false; @@ -950,6 +952,7 @@ namespace Trinity bool i_targetForPlayer; WorldObject const* i_obj; Unit const* i_funit; + SpellInfo const* _spellInfo; float i_range; }; |