Skip to content

Commit

Permalink
Only target part children by coverege if there are any
Browse files Browse the repository at this point in the history
  • Loading branch information
perkinslr committed Jun 23, 2024
1 parent b746214 commit 6097982
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,11 @@ private IEnumerable<DamageInfo> DamageInfosToApply(LocalTargetInfo target, bool

if (damageInfo.HitPart != null)
{
damageInfo.SetHitPart(damageInfo.HitPart.GetDirectChildParts().RandomElementByWeight(x => x.coverage));
var children = damageInfo.HitPart.GetDirectChildParts();
if (children.Count() > 0)
{
damageInfo.SetHitPart(children.RandomElementByWeight(x => x.coverage));
}
}
}
}
Expand Down

0 comments on commit 6097982

Please sign in to comment.