Add turret-linking support to HitShape

Allows to link a HitShape to the
position and facing of a turret.
This commit is contained in:
reaperrr
2018-06-19 07:26:19 +02:00
committed by abcdefg30
parent b839204c7f
commit 9dcba8710b
12 changed files with 103 additions and 65 deletions

View File

@@ -295,7 +295,7 @@ namespace OpenRA.Mods.Common.Projectiles
// If the impact position is within any actor's HitShape, we have a direct hit
var activeShapes = victim.TraitsImplementing<HitShape>().Where(Exts.IsTraitEnabled);
if (activeShapes.Any(i => i.Info.Type.DistanceFromEdge(pos, victim).Length <= 0))
if (activeShapes.Any(i => i.DistanceFromEdge(victim, pos).Length <= 0))
return true;
}