Core/Spell: Properly remove REACT_PASSIVE on permanent feign death unapply. Fixes and closes #21156.

This commit is contained in:
Treeston
2018-02-13 15:47:44 +01:00
parent fe3b4de1cd
commit ac8b9be5d6

View File

@@ -1095,8 +1095,8 @@ class spell_gen_creature_permanent_feign_death : public AuraScript
target->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
target->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
if (target->GetTypeId() == TYPEID_UNIT)
target->ToCreature()->SetReactState(REACT_PASSIVE);
if (Creature* creature = target->ToCreature())
creature->SetReactState(REACT_PASSIVE);
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
@@ -1104,6 +1104,9 @@ class spell_gen_creature_permanent_feign_death : public AuraScript
Unit* target = GetTarget();
target->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
target->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
if (Creature* creature = target->ToCreature())
creature->InitializeReactState();
}
void Register() override