fix(Core/Spells): Pass nullptr to KILL/KILLED/DEATH procs (#25074)
Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
@@ -14118,7 +14118,7 @@ bool Unit::HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackType attackType, SpellInfo const* spellProto, Spell const* spell /*= nullptr*/)
|
void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackType attackType, SpellInfo const* /*spellProto*/, Spell const* /*spell*/ /*= nullptr*/)
|
||||||
{
|
{
|
||||||
// Prevent killing unit twice (and giving reward from kill twice)
|
// Prevent killing unit twice (and giving reward from kill twice)
|
||||||
if (!victim->GetHealth())
|
if (!victim->GetHealth())
|
||||||
@@ -14232,20 +14232,21 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Do KILL and KILLED procs. KILL proc is called only for the unit who landed the killing blow (and its owner - for pets and totems) regardless of who tapped the victim
|
// Do KILL and KILLED procs. KILL proc is called only for the unit who landed the killing blow (and its owner - for pets and totems) regardless of who tapped the victim
|
||||||
|
// Spell context is not passed to avoid the killing spell's triggered status from suppressing nested proc events
|
||||||
if (killer && (killer->IsPet() || killer->IsTotem()))
|
if (killer && (killer->IsPet() || killer->IsTotem()))
|
||||||
if (Unit* owner = killer->GetOwner())
|
if (Unit* owner = killer->GetOwner())
|
||||||
{
|
{
|
||||||
Unit::ProcSkillsAndAuras(owner, victim, PROC_FLAG_KILL, PROC_FLAG_NONE, PROC_EX_NONE, 0, attackType, spellProto, nullptr, -1, spell);
|
Unit::ProcSkillsAndAuras(owner, victim, PROC_FLAG_KILL, PROC_FLAG_NONE, PROC_EX_NONE, 0, attackType, nullptr, nullptr, -1, nullptr);
|
||||||
sScriptMgr->OnPlayerCreatureKilledByPet( killer->GetCharmerOrOwnerPlayerOrPlayerItself(), victim->ToCreature());
|
sScriptMgr->OnPlayerCreatureKilledByPet( killer->GetCharmerOrOwnerPlayerOrPlayerItself(), victim->ToCreature());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (killer != victim)
|
if (killer != victim)
|
||||||
{
|
{
|
||||||
Unit::ProcSkillsAndAuras(killer, victim, killer ? PROC_FLAG_KILL : 0, PROC_FLAG_KILLED, PROC_EX_NONE, 0, attackType, spellProto, nullptr, -1, spell);
|
Unit::ProcSkillsAndAuras(killer, victim, killer ? PROC_FLAG_KILL : 0, PROC_FLAG_KILLED, PROC_EX_NONE, 0, attackType, nullptr, nullptr, -1, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Proc auras on death - must be before aura/combat remove
|
// Proc auras on death - must be before aura/combat remove
|
||||||
Unit::ProcSkillsAndAuras(victim, nullptr, PROC_FLAG_DEATH, PROC_FLAG_NONE, PROC_EX_NONE, 0, attackType, spellProto, nullptr, -1, spell);
|
Unit::ProcSkillsAndAuras(victim, nullptr, PROC_FLAG_DEATH, PROC_FLAG_NONE, PROC_EX_NONE, 0, attackType, nullptr, nullptr, -1, nullptr);
|
||||||
|
|
||||||
// update get killing blow achievements, must be done before setDeathState to be able to require auras on target
|
// update get killing blow achievements, must be done before setDeathState to be able to require auras on target
|
||||||
// and before Spirit of Redemption as it also removes auras
|
// and before Spirit of Redemption as it also removes auras
|
||||||
|
|||||||
Reference in New Issue
Block a user