Use DistanceFromEdge instead of OuterRadius for CreateEffectWarhead's hit check
This commit is contained in:
@@ -77,8 +77,8 @@ namespace OpenRA.Mods.Common.Warheads
|
|||||||
if (healthInfo == null)
|
if (healthInfo == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// If the impact position is within any actor's health radius, we have a direct hit
|
// If the impact position is within any actor's HitShape, we have a direct hit
|
||||||
if ((unit.CenterPosition - pos).LengthSquared <= healthInfo.Shape.OuterRadius.LengthSquared)
|
if ((unit.CenterPosition - pos).LengthSquared <= healthInfo.Shape.DistanceFromEdge(pos, unit).LengthSquared)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user