mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-16 04:59:41 -04:00
Core/SmartAI: SMART_ACTION_FORCE_DESPAWN for dead creatures
This commit is contained in:
@@ -1023,8 +1023,16 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
if (!IsSmart())
|
||||
break;
|
||||
|
||||
CAST_AI(SmartAI, me->AI())->SetDespawnTime(e.action.forceDespawn.delay + 1);//next tick
|
||||
CAST_AI(SmartAI, me->AI())->StartDespawn();
|
||||
// The AI is only updated if the creature is alive
|
||||
if (me->isAlive())
|
||||
{
|
||||
CAST_AI(SmartAI, me->AI())->SetDespawnTime(e.action.forceDespawn.delay + 1); // Next tick
|
||||
CAST_AI(SmartAI, me->AI())->StartDespawn();
|
||||
}
|
||||
// Otherwise we call the despawn directly
|
||||
else
|
||||
me->DespawnOrUnsummon(e.action.forceDespawn.delay);
|
||||
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SET_INGAME_PHASE_MASK:
|
||||
|
||||
Reference in New Issue
Block a user