fix(Core/SmartScripts): Allow SAI_ACTION_DIE to accept params (#16411)
This commit is contained in:
parent
44e461ce6f
commit
d204eccdea
4 changed files with 28 additions and 3 deletions
|
|
@ -1139,7 +1139,22 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
}
|
||||
case SMART_ACTION_DIE:
|
||||
{
|
||||
if (me && !me->isDead())
|
||||
if (e.action.die.milliseconds)
|
||||
{
|
||||
if (me && !me->isDead())
|
||||
{
|
||||
me->m_Events.AddEventAtOffset([&]
|
||||
{
|
||||
// We need to check again to see if we didn't die in the process.
|
||||
if (me && !me->isDead())
|
||||
{
|
||||
me->KillSelf();
|
||||
LOG_DEBUG("sql.sql", "SmartScript::ProcessAction: SMART_ACTION_DIE: Creature {}", me->GetGUID().ToString());
|
||||
}
|
||||
}, Milliseconds(e.action.die.milliseconds));
|
||||
}
|
||||
}
|
||||
else if (me && !me->isDead())
|
||||
{
|
||||
me->KillSelf();
|
||||
LOG_DEBUG("sql.sql", "SmartScript::ProcessAction: SMART_ACTION_DIE: Creature {}", me->GetGUID().ToString());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue