remove duplication in Mobile
This commit is contained in:
@@ -229,15 +229,7 @@ namespace OpenRA.Mods.RA.Move
|
|||||||
|
|
||||||
public CPos NearestMoveableCell(CPos target, int minRange, int maxRange)
|
public CPos NearestMoveableCell(CPos target, int minRange, int maxRange)
|
||||||
{
|
{
|
||||||
if (CanEnterCell(target))
|
return NearestCell(target, CanEnterCell, minRange, maxRange);
|
||||||
return target;
|
|
||||||
|
|
||||||
foreach (var tile in self.World.FindTilesInCircle(target, maxRange))
|
|
||||||
if (CanEnterCell(tile))
|
|
||||||
return tile;
|
|
||||||
|
|
||||||
// Couldn't find a cell
|
|
||||||
return target;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CPos NearestCell(CPos target, Func<CPos, bool> check, int minRange, int maxRange)
|
public CPos NearestCell(CPos target, Func<CPos, bool> check, int minRange, int maxRange)
|
||||||
|
|||||||
Reference in New Issue
Block a user