diff --git a/OpenRA.Game/CPos.cs b/OpenRA.Game/CPos.cs index 1557665202..55183f8f82 100644 --- a/OpenRA.Game/CPos.cs +++ b/OpenRA.Game/CPos.cs @@ -114,6 +114,5 @@ namespace OpenRA public static class WorldCoordinateExtensions { public static CPos ToCPos(this WPos a) { return new CPos(a.X / 1024, a.Y / 1024); } - public static CVec ToCVec(this WVec a) { return new CVec(a.X / 1024, a.Y / 1024); } } } \ No newline at end of file diff --git a/OpenRA.Mods.RA/Attack/AttackWander.cs b/OpenRA.Mods.RA/Attack/AttackWander.cs index 347d61cc3a..fb6adbd4d4 100644 --- a/OpenRA.Mods.RA/Attack/AttackWander.cs +++ b/OpenRA.Mods.RA/Attack/AttackWander.cs @@ -31,8 +31,8 @@ namespace OpenRA.Mods.RA public void TickIdle(Actor self) { - var offset = new WVec(0, -1024*Info.MoveRadius, 0).Rotate(WRot.FromFacing(self.World.SharedRandom.Next(255))).ToCVec(); - self.Trait().ResolveOrder(self, new Order("AttackMove", self, false) { TargetLocation = self.Location + offset }); + var target = self.CenterPosition + new WVec(0, -1024*Info.MoveRadius, 0).Rotate(WRot.FromFacing(self.World.SharedRandom.Next(255))); + self.Trait().ResolveOrder(self, new Order("AttackMove", self, false) { TargetLocation = target.ToCPos() }); } } }