From 3c38758f09a5067b8cbe76efbc12e87c039d02d4 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Thu, 23 Dec 2021 20:24:47 -0500 Subject: [PATCH] AI/SmartAI: Move SMART_EVENT_RESPAWN invocation from ::InitializeAI() to ::JustAppeared(). Port From (https://github.com/TrinityCore/TrinityCore/commit/e398bb16648b483c97a68b2a29b25173b2a71261) --- Source/Game/AI/SmartScripts/SmartAI.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Source/Game/AI/SmartScripts/SmartAI.cs b/Source/Game/AI/SmartScripts/SmartAI.cs index 05756bf2c..5f88fcd6d 100644 --- a/Source/Game/AI/SmartScripts/SmartAI.cs +++ b/Source/Game/AI/SmartScripts/SmartAI.cs @@ -568,12 +568,6 @@ namespace Game.AI me.SetVisible(true); - if (!me.IsDead()) - { - GetScript().ProcessEventsFor(SmartEvents.Respawn); - GetScript().OnReset(); - } - _followGuid.Clear();//do not reset follower on Reset(), we need it after combat evade _followDist = 0; _followAngle = 0; @@ -583,6 +577,15 @@ namespace Game.AI _followCreditType = 0; } + public override void JustAppeared() + { + if (me.IsDead()) + return; + + GetScript().ProcessEventsFor(SmartEvents.Respawn); + GetScript().OnReset(); + } + public override void JustReachedHome() { GetScript().OnReset();