remove duplication in Mobile

This commit is contained in:
Chris Forbes
2012-10-13 12:38:02 +13:00
parent 3fad0983b9
commit 403b51ca4b

View File

@@ -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<CPos, bool> check, int minRange, int maxRange)