mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
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 727f77ec6a)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user