Added missing null checks for DamageInfo struct

Misc spell fixes
This commit is contained in:
hondacrx
2017-09-06 11:24:12 -04:00
parent 443c00bd28
commit d578144150
9 changed files with 78 additions and 30 deletions
+10 -3
View File
@@ -483,9 +483,16 @@ namespace Scripts.Spells.Hunter
return ValidateSpellInfo(SpellIds.RoarOfSacrificeTriggered);
}
bool CheckProc(ProcEventInfo eventInfo)
bool CheckProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
return GetCaster() && ((uint)eventInfo.GetDamageInfo().GetSchoolMask() & GetEffect(1).GetMiscValue()) != 0;
DamageInfo damageInfo = eventInfo.GetDamageInfo();
if (damageInfo == null || !Convert.ToBoolean((int)damageInfo.GetSchoolMask() & aurEff.GetMiscValue()))
return false;
if (!GetCaster())
return false;
return true;
}
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
@@ -498,7 +505,7 @@ namespace Scripts.Spells.Hunter
public override void Register()
{
DoCheckProc.Add(new CheckProcHandler(CheckProc));
DoCheckEffectProc.Add(new CheckEffectProcHandler(CheckProc, 1, AuraType.Dummy));
OnEffectProc.Add(new EffectProcHandler(HandleProc, 1, AuraType.Dummy));
}
}