Core/Gameobject: remove immune flags from trigger used to cast GO spells

Spells were failing flags check in Unit::_IsValidAttackTarget

Closes #18206
This commit is contained in:
ariel- authored and Aokromes committed 2016-11-10 23:42:29 +01:00
1 parent 493dc8ed8f
commit 03c3279395
1 file changed
+3
@@ -1886,6 +1886,9 @@ void GameObject::CastSpell(Unit* target, uint32 spellId, TriggerCastFlags trigge
if (!trigger)
return;
// remove immunity flags, to allow spell to target anything
trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC);
if (Unit* owner = GetOwner())
{
trigger->setFaction(owner->getFaction());