Core/Unit: Some charm fixes:

Port From (https://github.com/TrinityCore/TrinityCore/commit/34f9666f209ab3f281bf81de92c4bc1a164b0059)
This commit is contained in:
hondacrx
2021-11-02 14:14:58 -04:00
parent 430d163dee
commit 78a466e5b6
5 changed files with 45 additions and 45 deletions
+10 -3
View File
@@ -732,9 +732,16 @@ namespace Game.AI
else
me.SetWalk(!_run);
Unit charmer = me.GetCharmer();
if (charmer)
AttackStart(charmer);
if (!me.LastCharmerGUID.IsEmpty())
{
if (!me.HasReactState(ReactStates.Passive))
{
Unit lastCharmer = Global.ObjAccessor.GetUnit(me, me.LastCharmerGUID);
if (lastCharmer != null)
me.EngageWithTarget(lastCharmer);
}
me.LastCharmerGUID.Clear();
}
}
GetScript().ProcessEventsFor(SmartEvents.Charmed, null, 0, 0, charmed);