mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-14 12:12:34 -04:00
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.
(cherry picked from commit 3267c90102)
# Conflicts:
# src/server/game/AI/SmartScripts/SmartScript.cpp
This commit is contained in:
@@ -1001,7 +1001,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: %s", me->GetGUID().ToString().c_str());
|
||||
}
|
||||
break;
|
||||
@@ -1282,7 +1282,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;
|
||||
|
||||
Reference in New Issue
Block a user