From 403b51ca4bf68c916c406d17c7f0dadf967474c6 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 13 Oct 2012 12:38:02 +1300 Subject: [PATCH] remove duplication in Mobile --- OpenRA.Mods.RA/Move/Mobile.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/OpenRA.Mods.RA/Move/Mobile.cs b/OpenRA.Mods.RA/Move/Mobile.cs index a5117c215b..35b198f81c 100755 --- a/OpenRA.Mods.RA/Move/Mobile.cs +++ b/OpenRA.Mods.RA/Move/Mobile.cs @@ -229,15 +229,7 @@ namespace OpenRA.Mods.RA.Move public CPos NearestMoveableCell(CPos target, int minRange, int maxRange) { - if (CanEnterCell(target)) - return target; - - foreach (var tile in self.World.FindTilesInCircle(target, maxRange)) - if (CanEnterCell(tile)) - return tile; - - // Couldn't find a cell - return target; + return NearestCell(target, CanEnterCell, minRange, maxRange); } public CPos NearestCell(CPos target, Func check, int minRange, int maxRange)