From de6b8b0240802d3047f7e06b66f525da76f1ca1e Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 23 Jun 2021 22:33:07 -0400 Subject: [PATCH] Core/Spell: Properly remove REACT_PASSIVE on permanent feign death unapply. Port From (https://github.com/TrinityCore/TrinityCore/commit/ffce2c1f9a416eddad2e45ab2e03df964d5e39cd) --- Source/Scripts/Spells/Generic.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Source/Scripts/Spells/Generic.cs b/Source/Scripts/Spells/Generic.cs index 11bb12e40..c782cd051 100644 --- a/Source/Scripts/Spells/Generic.cs +++ b/Source/Scripts/Spells/Generic.cs @@ -1203,8 +1203,9 @@ namespace Scripts.Spells.Generic target.AddDynamicFlag(UnitDynFlags.Dead); target.AddUnitFlag2(UnitFlags2.FeignDeath); - if (target.IsTypeId(TypeId.Unit)) - target.ToCreature().SetReactState(ReactStates.Passive); + Creature creature = target.ToCreature(); + if (creature != null) + creature.SetReactState(ReactStates.Passive); } void OnRemove(AuraEffect aurEff, AuraEffectHandleModes mode) @@ -1212,6 +1213,10 @@ namespace Scripts.Spells.Generic Unit target = GetTarget(); target.RemoveDynamicFlag(UnitDynFlags.Dead); target.RemoveUnitFlag2(UnitFlags2.FeignDeath); + + Creature creature = target.ToCreature(); + if (creature != null) + creature.InitializeReactState(); } public override void Register()