diff options
author | SnapperRy <snapperryen@gmail.com> | 2016-10-14 22:34:08 +0200 |
---|---|---|
committer | joschiwald <joschiwald.trinity@gmail.com> | 2017-10-03 15:31:09 +0200 |
commit | 53dde7e2ca04dd2773eaad751ac04a7ab3fcf75f (patch) | |
tree | cce97cba6388f58c9dd8eb105e9ab2d44181a62a /src | |
parent | d4fa2cf43fd37122be7ffa32af126697b8c37acb (diff) |
Core/SAI: always use DespawnOrUnsummon() for SMART_ACTION_FORCE_DESPAWN.
SmartAI uses that same method internally, so there's no need to handle it in two different ways.
Does not affect functionality, but prevents useless SAI error log in case the target creature is not using SAI.
(cherry picked from commit 727f77ec6ab9b507d86ffc482b2801fb5b9b907e)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index a0405a5658f..58353d29650 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1230,20 +1230,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { if (Creature* target = (*itr)->ToCreature()) - { - if (target->IsAlive() && IsSmart(target)) - { - ENSURE_AI(SmartAI, target->AI())->SetDespawnTime(e.action.forceDespawn.delay + 1, e.action.forceDespawn.respawn); // Next tick - ENSURE_AI(SmartAI, target->AI())->StartDespawn(); - } - else - target->DespawnOrUnsummon(e.action.forceDespawn.delay, Seconds(e.action.forceDespawn.respawn)); - } + target->DespawnOrUnsummon(e.action.forceDespawn.delay, Seconds(e.action.forceDespawn.respawn)); else if (GameObject* goTarget = (*itr)->ToGameObject()) goTarget->SetRespawnTime(e.action.forceDespawn.delay + 1); - } delete targets; break; |