From 88ff97c1f96381565c47f8ca1993bdc7fce19fd6 Mon Sep 17 00:00:00 2001 From: Teleqraph Date: Thu, 20 Jul 2023 19:09:27 +0200 Subject: Core/Units: Added helper functions to modify UNIT_FLAG_UNINTERACTIBLE (#29159) Co-authored-by: Shauren --- src/server/scripts/Spells/spell_generic.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/server/scripts/Spells') diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 6c6f88e0ba6..7257fc43cb9 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1779,7 +1779,9 @@ class spell_gen_feign_death_all_flags_uninteractible : public AuraScript Unit* target = GetTarget(); target->SetUnitFlag3(UNIT_FLAG3_FAKE_DEAD); target->SetUnitFlag2(UNIT_FLAG2_FEIGN_DEATH); - target->SetUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_UNINTERACTIBLE); + target->SetUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT); + target->SetImmuneToAll(true); + target->SetUninteractible(true); if (Creature* creature = target->ToCreature()) creature->SetReactState(REACT_PASSIVE); @@ -1790,7 +1792,9 @@ class spell_gen_feign_death_all_flags_uninteractible : public AuraScript Unit* target = GetTarget(); target->RemoveUnitFlag3(UNIT_FLAG3_FAKE_DEAD); target->RemoveUnitFlag2(UNIT_FLAG2_FEIGN_DEATH); - target->RemoveUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_UNINTERACTIBLE); + target->RemoveUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT); + target->SetImmuneToAll(false); + target->SetUninteractible(false); if (Creature* creature = target->ToCreature()) creature->InitializeReactState(); -- cgit v1.2.3