aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2012-03-28 01:13:58 +0200
committerShauren <shauren.trinity@gmail.com>2012-03-28 01:13:58 +0200
commitae0511a2a445dc189ed1c822a43e23adb3d644b0 (patch)
tree252dc7fb0ed405a360c96abc055250698112bb3d
parentb4f9cb6aa84ce78077a14b5976f0e5b2322428d6 (diff)
Core/Spells: Fix DynamicObject AoE effects for invisible targets e.g Flare. Original patch by Elron
Closes #5898
-rwxr-xr-xsrc/server/game/Grids/Notifiers/GridNotifiers.h7
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;
};