From 4bc09692e06cf745ff705e8708de8f391e54e7ef Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Tue, 17 Sep 2013 22:43:11 +1200 Subject: [PATCH] Remove WVec.ToCVec. --- OpenRA.Game/CPos.cs | 1 - OpenRA.Mods.RA/Attack/AttackWander.cs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) 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() }); } } }