Use DistanceFromEdge instead of OuterRadius for CreateEffectWarhead's hit check

This commit is contained in:
reaperrr
2016-01-01 15:45:18 +01:00
parent 671f5af723
commit d93a3a61ee

View File

@@ -77,8 +77,8 @@ namespace OpenRA.Mods.Common.Warheads
if (healthInfo == null)
continue;
// If the impact position is within any actor's health radius, we have a direct hit
if ((unit.CenterPosition - pos).LengthSquared <= healthInfo.Shape.OuterRadius.LengthSquared)
// If the impact position is within any actor's HitShape, we have a direct hit
if ((unit.CenterPosition - pos).LengthSquared <= healthInfo.Shape.DistanceFromEdge(pos, unit).LengthSquared)
return true;
}