Add plumbing for targeting of target center instead of closest targetable position

Note: Projectiles that can track their target need minor additional changes, but for InstantHit (which already implemented support for this) and unguided projectiles (Bullet, GravityBomb) this commit is already sufficient.
This commit is contained in:
reaperrr
2017-06-11 21:41:12 +02:00
committed by abcdefg30
parent 9c9a23be86
commit da7433a95f
6 changed files with 16 additions and 5 deletions

View File

@@ -146,7 +146,7 @@ namespace OpenRA.Mods.Common.Traits
return;
var pos = self.CenterPosition;
var targetedPosition = target.Positions.PositionClosestTo(pos);
var targetedPosition = Info.AttackTargetCenter ? target.CenterPosition : target.Positions.PositionClosestTo(pos);
var targetYaw = (targetedPosition - pos).Yaw;
foreach (var a in Armaments)