Make attacking actors/turrets face the targeted position
This commit is contained in:
committed by
Oliver Brakmann
parent
7acc6dacbc
commit
6a212eea53
@@ -39,7 +39,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return false;
|
||||
|
||||
var f = facing.Facing;
|
||||
var delta = target.CenterPosition - self.CenterPosition;
|
||||
var pos = self.CenterPosition;
|
||||
var targetedPosition = target.Positions.PositionClosestTo(pos);
|
||||
var delta = targetedPosition - pos;
|
||||
var facingToTarget = delta.HorizontalLengthSquared != 0 ? delta.Yaw.Facing : f;
|
||||
|
||||
if (Math.Abs(facingToTarget - f) % 256 > info.FacingTolerance)
|
||||
|
||||
Reference in New Issue
Block a user