Core/SmartAI: SMART_ACTION_FORCE_DESPAWN for dead creatures

This commit is contained in:
Gacko
2013-03-26 21:49:22 +01:00
parent d7d62e4248
commit e635ba5b81

View File

@@ -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: