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)
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user