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
+5 -1
View File
@@ -1360,7 +1360,11 @@ namespace Scripts.Spells.Items
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
PreventDefaultAction();
int bp = (int)MathFunctions.CalculatePct(eventInfo.GetDamageInfo().GetDamage(), aurEff.GetAmount());
DamageInfo damageInfo = eventInfo.GetDamageInfo();
if (damageInfo == null || damageInfo.GetDamage() == 0)
return;
int bp = (int)MathFunctions.CalculatePct(damageInfo.GetDamage(), aurEff.GetAmount());
GetTarget().CastCustomSpell(SpellIds.ItemNecroticTouchProc, SpellValueMod.BasePoint0, bp, eventInfo.GetProcTarget(), true, null, aurEff);
}