Core/SmartAI: SMART_ACTION_FORCE_DESPAWN for dead creatures
This commit is contained in:
1 parent
d7d62e4248
commit
e635ba5b81
1 file changed
+10
-2
@@ -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