mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 15:40:45 +01:00
Core/AI: Fix creatures not updating their target properly once engaged
Closes #21562
(cherry picked from commit 7fb7432620)
This commit is contained in:
@@ -285,6 +285,8 @@ void SmartAI::UpdateAI(uint32 diff)
|
||||
|
||||
CheckConditions(diff);
|
||||
|
||||
bool hasVictim = UpdateVictim();
|
||||
|
||||
GetScript()->OnUpdate(diff);
|
||||
|
||||
UpdatePath(diff);
|
||||
@@ -294,7 +296,7 @@ void SmartAI::UpdateAI(uint32 diff)
|
||||
if (!IsAIControlled())
|
||||
return;
|
||||
|
||||
if (!UpdateVictim())
|
||||
if (!hasVictim)
|
||||
return;
|
||||
|
||||
if (_canAutoAttack)
|
||||
|
||||
Reference in New Issue
Block a user