Make attacking actors/turrets face the targeted position
This commit is contained in:
committed by
Oliver Brakmann
parent
7acc6dacbc
commit
6a212eea53
@@ -130,7 +130,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (self.IsDisabled())
|
||||
return false;
|
||||
|
||||
var delta = target.CenterPosition - self.CenterPosition;
|
||||
var pos = self.CenterPosition;
|
||||
var delta = target.Positions.PositionClosestTo(pos) - pos;
|
||||
DesiredFacing = delta.HorizontalLengthSquared != 0 ? delta.Yaw.Facing : TurretFacing;
|
||||
MoveTurret();
|
||||
return HasAchievedDesiredFacing;
|
||||
|
||||
Reference in New Issue
Block a user