mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 17:49:10 +00:00
fix(Core/Spells): add several missing null checks for the DamageInfo struct to fix a crash (#8322)
This commit is contained in:
@@ -670,7 +670,9 @@ public:
|
||||
{
|
||||
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
|
||||
if (!spellInfo || !spellInfo->HasEffect(SPELL_EFFECT_HEAL))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return spellInfo->ManaCost > 0 || spellInfo->ManaCostPercentage > 0 || (spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN && spellInfo->SpellIconID == 156);
|
||||
}
|
||||
@@ -2418,7 +2420,15 @@ public:
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
int32 bp = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount());
|
||||
|
||||
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||
|
||||
if (!damageInfo || !damageInfo->GetDamage())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int32 bp = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount());
|
||||
GetTarget()->CastCustomSpell(SPELL_ITEM_NECROTIC_TOUCH_PROC, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetProcTarget(), true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user