Skip to content

Commit c51d036

Browse files
blinkyscShauren
andauthored
fix(Core/Spells): Pass nullptr to KILL/KILLED/DEATH procs (azerothcore#25074)
Co-authored-by: Shauren <shauren.trinity@gmail.com>
1 parent a724b66 commit c51d036

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/server/game/Entities/Unit/Unit.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14118,7 +14118,7 @@ bool Unit::HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura)
1411814118
return true;
1411914119
}
1412014120

14121-
void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackType attackType, SpellInfo const* spellProto, Spell const* spell /*= nullptr*/)
14121+
void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackType attackType, SpellInfo const* /*spellProto*/, Spell const* /*spell*/ /*= nullptr*/)
1412214122
{
1412314123
// Prevent killing unit twice (and giving reward from kill twice)
1412414124
if (!victim->GetHealth())
@@ -14232,20 +14232,21 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
1423214232
}
1423314233

1423414234
// 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
14235+
// Spell context is not passed to avoid the killing spell's triggered status from suppressing nested proc events
1423514236
if (killer && (killer->IsPet() || killer->IsTotem()))
1423614237
if (Unit* owner = killer->GetOwner())
1423714238
{
14238-
Unit::ProcSkillsAndAuras(owner, victim, PROC_FLAG_KILL, PROC_FLAG_NONE, PROC_EX_NONE, 0, attackType, spellProto, nullptr, -1, spell);
14239+
Unit::ProcSkillsAndAuras(owner, victim, PROC_FLAG_KILL, PROC_FLAG_NONE, PROC_EX_NONE, 0, attackType, nullptr, nullptr, -1, nullptr);
1423914240
sScriptMgr->OnPlayerCreatureKilledByPet( killer->GetCharmerOrOwnerPlayerOrPlayerItself(), victim->ToCreature());
1424014241
}
1424114242

1424214243
if (killer != victim)
1424314244
{
14244-
Unit::ProcSkillsAndAuras(killer, victim, killer ? PROC_FLAG_KILL : 0, PROC_FLAG_KILLED, PROC_EX_NONE, 0, attackType, spellProto, nullptr, -1, spell);
14245+
Unit::ProcSkillsAndAuras(killer, victim, killer ? PROC_FLAG_KILL : 0, PROC_FLAG_KILLED, PROC_EX_NONE, 0, attackType, nullptr, nullptr, -1, nullptr);
1424514246
}
1424614247

1424714248
// Proc auras on death - must be before aura/combat remove
14248-
Unit::ProcSkillsAndAuras(victim, nullptr, PROC_FLAG_DEATH, PROC_FLAG_NONE, PROC_EX_NONE, 0, attackType, spellProto, nullptr, -1, spell);
14249+
Unit::ProcSkillsAndAuras(victim, nullptr, PROC_FLAG_DEATH, PROC_FLAG_NONE, PROC_EX_NONE, 0, attackType, nullptr, nullptr, -1, nullptr);
1424914250

1425014251
// update get killing blow achievements, must be done before setDeathState to be able to require auras on target
1425114252
// and before Spirit of Redemption as it also removes auras

0 commit comments

Comments
 (0)