Skip to content

Commit

Permalink
Add another GetEntitiesInRange overload
Browse files Browse the repository at this point in the history
  • Loading branch information
metalgearsloth committed Nov 20, 2023
1 parent 96cb52e commit 51961d3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Robust.Shared/GameObjects/Systems/EntityLookup.Queries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,17 @@ public HashSet<EntityUid> GetEntitiesInRange(EntityUid uid, float range, LookupF
return intersecting;
}

public void GetEntitiesInRange(EntityUid uid, float range, HashSet<EntityUid> entities, LookupFlags flags = DefaultFlags)
{
var mapPos = _transform.GetMapCoordinates(uid);

if (mapPos.MapId == MapId.Nullspace)
return;

GetEntitiesInRange(mapPos.MapId, mapPos.Position, range, entities, flags);
entities.Remove(uid);
}

public HashSet<EntityUid> GetEntitiesIntersecting(EntityUid uid, LookupFlags flags = DefaultFlags)
{
var xform = _xformQuery.GetComponent(uid);
Expand Down

0 comments on commit 51961d3

Please sign in to comment.