fix(Core/Entities): add missing nul pointer checks in HandleProcTrigger Spell (#9303)

This commit is contained in:
IntelligentQuantum
2021-11-29 19:50:40 +03:30
committed by GitHub
parent 1ee5484882
commit 683b7ae1e2

View File

@@ -8938,7 +8938,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
case 53232:
{
// This effect only from Rapid Fire (ability cast)
if (!(procSpell->SpellFamilyFlags[0] & 0x20))
if (!procSpell || !(procSpell->SpellFamilyFlags[0] & 0x20))
return false;
break;
}
@@ -9214,7 +9214,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
// Astral Shift
case 52179:
{
if (procSpell == 0 || !(procEx & (PROC_EX_NORMAL_HIT | PROC_EX_CRITICAL_HIT)) || this == victim)
if (!procSpell || !(procEx & (PROC_EX_NORMAL_HIT | PROC_EX_CRITICAL_HIT)) || this == victim)
return false;
// Need stun, fear or silence mechanic
@@ -9249,13 +9249,17 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
case 65081:
{
// Proc only from PW:S cast
if (!(procSpell->SpellFamilyFlags[0] & 0x00000001))
if (!procSpell || !(procSpell->SpellFamilyFlags[0] & 0x00000001))
return false;
break;
}
// Culling the Herd
case 70893:
{
if (!procSpell)
{
return false;
}
// check if we're doing a critical hit
if (!(procSpell->SpellFamilyFlags[1] & 0x10000000) && (procEx != PROC_EX_CRITICAL_HIT))
return false;