diff options
author | Shauren <shauren.trinity@gmail.com> | 2012-03-28 01:13:58 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2012-03-28 01:13:58 +0200 |
commit | ae0511a2a445dc189ed1c822a43e23adb3d644b0 (patch) | |
tree | 252dc7fb0ed405a360c96abc055250698112bb3d | |
parent | b4f9cb6aa84ce78077a14b5976f0e5b2322428d6 (diff) |
Core/Spells: Fix DynamicObject AoE effects for invisible targets e.g Flare. Original patch by Elron
Closes #5898
-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; }; |