fix(Core/Spells): add several missing null checks for the DamageInfo struct to fix a crash - Part II. (#8376)

This commit is contained in:
UltraNix
2021-10-10 15:56:42 +02:00
committed by GitHub
parent 760e043116
commit 66809383d1
13 changed files with 48 additions and 41 deletions

View File

@@ -1059,15 +1059,16 @@ public:
bool CheckProc(ProcEventInfo& eventInfo)
{
SpellInfo const* procSpell = eventInfo.GetDamageInfo()->GetSpellInfo();
return eventInfo.GetActor() && eventInfo.GetActionTarget() && (eventInfo.GetDamageInfo()->GetDamage() || eventInfo.GetHitMask() & PROC_EX_ABSORB) && procSpell && procSpell->SpellIconID != 2731; // Xinef: Mark of the Fallen Champion
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
SpellInfo const* procSpell = eventInfo.GetSpellInfo();
return eventInfo.GetActor() && eventInfo.GetActionTarget() && ((damageInfo && damageInfo->GetDamage()) || eventInfo.GetHitMask() & PROC_EX_ABSORB) && procSpell && procSpell->SpellIconID != 2731; // Xinef: Mark of the Fallen Champion
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* victim = eventInfo.GetActionTarget();
SpellInfo const* procSpell = eventInfo.GetDamageInfo()->GetSpellInfo();
SpellInfo const* procSpell = eventInfo.GetSpellInfo();
//uint32 markCount = 0;
//if (Creature* saurfang = eventInfo.GetActor()->ToCreature())
@@ -1091,7 +1092,6 @@ public:
{
DoCheckProc += AuraCheckProcFn(spell_deathbringer_blood_link_AuraScript::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_deathbringer_blood_link_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_deathbringer_blood_link_AuraScript::HandlePeriodicTick, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
}
};
@@ -1113,8 +1113,9 @@ public:
bool CheckProc(ProcEventInfo& eventInfo)
{
SpellInfo const* procSpell = eventInfo.GetDamageInfo()->GetSpellInfo();
return eventInfo.GetActor() && eventInfo.GetActionTarget() && (eventInfo.GetDamageInfo()->GetDamage() || eventInfo.GetHitMask() & PROC_EX_ABSORB) && (!procSpell || procSpell->SpellIconID != 2731); // Xinef: Mark of the Fallen Champion
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
SpellInfo const* procSpell = eventInfo.GetSpellInfo();
return eventInfo.GetActor() && eventInfo.GetActionTarget() && ((damageInfo && damageInfo->GetDamage()) || eventInfo.GetHitMask() & PROC_EX_ABSORB) && (!procSpell || procSpell->SpellIconID != 2731); // Xinef: Mark of the Fallen Champion
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)

View File

@@ -947,7 +947,7 @@ public:
bool CheckProc(ProcEventInfo& eventInfo)
{
const SpellInfo* spellInfo = eventInfo.GetDamageInfo()->GetSpellInfo();
const SpellInfo* spellInfo = eventInfo.GetSpellInfo();
if (!spellInfo)
return false;