Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Core/Spells: Fix DynamicObject AoE effects for invisible targets e.g.…

… Flare (thx to kandera) closes #3179
  • Loading branch information...
commit f860df7a83cc1605bb26c841a57d861cca778567 1 parent 7daf69f
@Elron103 authored
View
4 src/server/game/Entities/Unit/Unit.cpp
@@ -12117,9 +12117,9 @@ bool Unit::isTargetableForAttack(bool checkFakeDeath) const
return !HasUnitState(UNIT_STATE_UNATTACKABLE) && (!checkFakeDeath || !HasUnitState(UNIT_STATE_DIED));
}
-bool Unit::IsValidAttackTarget(Unit const* target) const
+bool Unit::IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) const
{
- return _IsValidAttackTarget(target, NULL);
+ return _IsValidAttackTarget(target, bySpell);
}
// function based on function Unit::CanAttack from 13850 client
View
2  src/server/game/Entities/Unit/Unit.h
@@ -1569,7 +1569,7 @@ class Unit : public WorldObject
bool isTargetableForAttack(bool checkFakeDeath = true) const;
- bool IsValidAttackTarget(Unit const* target) const;
+ bool IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell = NULL) const;
bool _IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) const;
bool IsValidAssistTarget(Unit const* target) const;
View
6 src/server/game/Grids/Notifiers/GridNotifiers.h
@@ -941,6 +941,12 @@ namespace Trinity
if (u->GetTypeId() == TYPEID_UNIT && ((Creature*)u)->isTotem())
return false;
+ // Special case for dynamic objects, need to pass spellinfo
+ if (i_obj->GetTypeId() == TYPEID_DYNAMICOBJECT)
+ if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(((DynamicObject*)i_obj)->GetSpellId()))
+ if (i_funit->IsValidAttackTarget(u, spellInfo) && i_obj->IsWithinDistInMap(u, i_range))
+ return true;
+
if (i_funit->IsValidAttackTarget(u) && i_obj->IsWithinDistInMap(u, i_range))
return true;
Please sign in to comment.
Something went wrong with that request. Please try again.