Adapt Attack logic to Weapon.TargetActorCenter

This commit is contained in:
reaperrr
2017-06-22 12:39:40 +02:00
committed by Paul Chote
parent edffaa4987
commit 33e8bf9928
9 changed files with 29 additions and 13 deletions

View File

@@ -131,7 +131,7 @@ namespace OpenRA.Mods.Common.Traits
return false;
var pos = self.CenterPosition;
var targetPos = attack != null && attack.Info.AttackTargetCenter ? target.CenterPosition : target.Positions.PositionClosestTo(pos);
var targetPos = attack != null ? attack.GetTargetPosition(pos, target) : target.CenterPosition;
var delta = targetPos - pos;
DesiredFacing = delta.HorizontalLengthSquared != 0 ? delta.Yaw.Facing : TurretFacing;
MoveTurret();