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

@@ -114,7 +114,7 @@ namespace OpenRA.Mods.Common.Activities
return NextActivity;
}
var targetedPosition = Target.Positions.PositionClosestTo(pos);
var targetedPosition = attack.Info.AttackTargetCenter ? Target.CenterPosition : Target.Positions.PositionClosestTo(pos);
var desiredFacing = (targetedPosition - pos).Yaw.Facing;
if (facing.Facing != desiredFacing)
{