Core/Unit: Add Unit::KillSelf() overload

Add Unit::KillSelf() function as overload of Unit::Kill(this) . Use KillSelf() whenever the killer and the victim are the same to clearly state the Unit is going to kill itself.
This commit is contained in:
jackpoz
2015-12-07 20:06:02 +01:00
parent ee12982008
commit 3267c90102
30 changed files with 55 additions and 54 deletions

View File

@@ -979,7 +979,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
if (me && !me->isDead())
{
me->Kill(me);
me->KillSelf();
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction: SMART_ACTION_DIE: Creature %u", me->GetGUID().GetCounter());
}
break;
@@ -1249,7 +1249,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (!IsUnit(*itr))
continue;
(*itr)->ToUnit()->Kill((*itr)->ToUnit());
(*itr)->ToUnit()->KillSelf();
}
delete targets;