Add world coords overload of FindUnitsInCircle.
This commit is contained in:
@@ -39,6 +39,11 @@ namespace OpenRA
|
|||||||
return actors.OrderBy( a => (a.CenterLocation - px).LengthSquared ).FirstOrDefault();
|
return actors.OrderBy( a => (a.CenterLocation - px).LengthSquared ).FirstOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IEnumerable<Actor> FindUnitsInCircle(this World world, WPos a, WRange r)
|
||||||
|
{
|
||||||
|
return world.FindUnitsInCircle(PPos.FromWPos(a), r.Range * Game.CellSize / 1024);
|
||||||
|
}
|
||||||
|
|
||||||
public static IEnumerable<Actor> FindUnitsInCircle(this World world, PPos a, int r)
|
public static IEnumerable<Actor> FindUnitsInCircle(this World world, PPos a, int r)
|
||||||
{
|
{
|
||||||
using (new PerfSample("FindUnitsInCircle"))
|
using (new PerfSample("FindUnitsInCircle"))
|
||||||
|
|||||||
Reference in New Issue
Block a user