aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSnapperRy <snapperryen@gmail.com>2016-10-14 22:34:08 +0200
committerSnapperRy <snapperryen@gmail.com>2016-10-14 22:36:22 +0200
commit727f77ec6ab9b507d86ffc482b2801fb5b9b907e (patch)
treef68c37e4cc317a03d15b549c2ed9ee31c755ee84 /src
parentb4b8a7477bcab15cb25a15bd3271279ae3220c94 (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.
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp12
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 a00fa19a1e6..d3d2be4aed5 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -1067,20 +1067,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); // Next tick
- ENSURE_AI(SmartAI, target->AI())->StartDespawn();
- }
- else
- target->DespawnOrUnsummon(e.action.forceDespawn.delay);
- }
+ target->DespawnOrUnsummon(e.action.forceDespawn.delay);
else if (GameObject* goTarget = (*itr)->ToGameObject())
goTarget->SetRespawnTime(e.action.forceDespawn.delay + 1);
- }
delete targets;
break;