diff --git a/OpenRA.Game/CVec.cs b/OpenRA.Game/CVec.cs index d21a4c21ff..aad8d732d3 100644 --- a/OpenRA.Game/CVec.cs +++ b/OpenRA.Game/CVec.cs @@ -73,5 +73,17 @@ namespace OpenRA } public override string ToString() { return "{0},{1}".F(X, Y); } + + public static readonly CVec[] directions = + { + new CVec(-1, -1), + new CVec(-1, 0), + new CVec(-1, 1), + new CVec(0, -1), + new CVec(0, 1), + new CVec(1, -1), + new CVec(1, 0), + new CVec(1, 1), + }; } } diff --git a/OpenRA.Mods.RA/Move/PathSearch.cs b/OpenRA.Mods.RA/Move/PathSearch.cs index 2775e3a3de..efd79d2c7e 100755 --- a/OpenRA.Mods.RA/Move/PathSearch.cs +++ b/OpenRA.Mods.RA/Move/PathSearch.cs @@ -44,7 +44,7 @@ namespace OpenRA.Mods.RA.Move queue = new PriorityQueue(); considered = new HashSet(); maxCost = 0; - nextDirections = directions.Select(d => new Pair(d, 0)).ToArray(); + nextDirections = CVec.directions.Select(d => new Pair(d, 0)).ToArray(); } public PathSearch InReverse() @@ -190,18 +190,6 @@ namespace OpenRA.Mods.RA.Move return p.Location; } - static readonly CVec[] directions = - { - new CVec( -1, -1 ), - new CVec( -1, 0 ), - new CVec( -1, 1 ), - new CVec( 0, -1 ), - new CVec( 0, 1 ), - new CVec( 1, -1 ), - new CVec( 1, 0 ), - new CVec( 1, 1 ), - }; - public void AddInitialCell(CPos location) { if (!world.Map.IsInMap(location.X, location.Y))