From acfe9946c6822de7d425d6f5f8a039a207f94b27 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 5 Jan 2022 23:46:16 -0500 Subject: [PATCH] Core/AI: Fix creatures not updating their target properly once engaged Port From (https://github.com/TrinityCore/TrinityCore/commit/d946d74ff9f2d4bec8b78a6b7ea85fbb9daefeb5) --- Source/Game/AI/SmartScripts/SmartAI.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Game/AI/SmartScripts/SmartAI.cs b/Source/Game/AI/SmartScripts/SmartAI.cs index 59d472825..1c03cad88 100644 --- a/Source/Game/AI/SmartScripts/SmartAI.cs +++ b/Source/Game/AI/SmartScripts/SmartAI.cs @@ -331,6 +331,8 @@ namespace Game.AI CheckConditions(diff); + bool hasVictim = UpdateVictim(); + GetScript().OnUpdate(diff); UpdatePath(diff); @@ -340,7 +342,7 @@ namespace Game.AI if (!IsAIControlled()) return; - if (!UpdateVictim()) + if (!hasVictim) return; if (_canAutoAttack)