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
@@ -258,7 +258,11 @@ namespace Scripts.Spells.Paladin
void HandleEffectProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
PreventDefaultAction();
int damage = (int)MathFunctions.CalculatePct(eventInfo.GetDamageInfo().GetDamage(), aurEff.GetAmount());
DamageInfo damageInfo = eventInfo.GetDamageInfo();
if (damageInfo == null || damageInfo.GetDamage() == 0)
return;
int damage = (int)MathFunctions.CalculatePct(damageInfo.GetDamage(), aurEff.GetAmount());
GetTarget().CastCustomSpell(SpellIds.EyeForAnEyeDamage, SpellValueMod.BasePoint0, damage, eventInfo.GetProcTarget(), true, null, aurEff);
}