Add some DamageInfo null checks

This commit is contained in:
ariel- authored and roc13x committed 2017-05-04 00:17:13 +01:00
1 parent 754c22d3d0
commit a6b4f239a4
7 files changed
+38 -13

No files matched your search

+5 -3
View File
@@ -114,7 +114,8 @@ class spell_gen_adaptive_warding : public SpellScriptLoader
bool CheckProc(ProcEventInfo& eventInfo)
{
if (eventInfo.GetDamageInfo()->GetSpellInfo()) // eventInfo.GetSpellInfo()
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
if (!damageInfo || !damageInfo->GetSpellInfo())
return false;
// find Mage Armor
@@ -157,7 +158,7 @@ class spell_gen_adaptive_warding : public SpellScriptLoader
default:
return;
}
GetTarget()->CastSpell(GetTarget(), spellId, true, NULL, aurEff);
GetTarget()->CastSpell(GetTarget(), spellId, true, nullptr, aurEff);
}
void Register() override
@@ -2149,7 +2150,8 @@ class spell_gen_obsidian_armor : public SpellScriptLoader
bool CheckProc(ProcEventInfo& eventInfo)
{
if (eventInfo.GetDamageInfo()->GetSpellInfo()) // eventInfo.GetSpellInfo()
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
if (!damageInfo || !damageInfo->GetSpellInfo())
return false;
if (GetFirstSchoolInMask(eventInfo.GetSchoolMask()) == SPELL_SCHOOL_NORMAL)