diff options
| author | Killyana <morphone1@gmail.com> | 2019-12-30 19:03:14 +0100 |
|---|---|---|
| committer | Killyana <morphone1@gmail.com> | 2019-12-30 19:03:14 +0100 |
| commit | 7fb74326205acbc5c0fa6b2aa9731d891e788d64 (patch) | |
| tree | 8a3fecd6464bd2d1d3ad33f8680e597fe989a692 /src | |
| parent | 88a14251e2765880e90cb41be7919cd39e3308e2 (diff) | |
Core/AI: Fix creatures not updating their target properly once engaged
Closes #21562
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartAI.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 9dd7f4dbb15..89b918478cf 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -283,6 +283,8 @@ void SmartAI::UpdateAI(uint32 diff) CheckConditions(diff); + bool hasVictim = UpdateVictim(); + GetScript()->OnUpdate(diff); UpdatePath(diff); @@ -292,7 +294,7 @@ void SmartAI::UpdateAI(uint32 diff) if (!IsAIControlled()) return; - if (!UpdateVictim()) + if (!hasVictim) return; if (_canAutoAttack) |
