Port cleanbots from Nyano (#9853)

This commit is contained in:
Rane
2022-07-17 23:48:36 -04:00
committed by GitHub
parent f8b8b83657
commit 1e8efb1dd5
9 changed files with 205 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
using Content.Server.Fluids.Components;
namespace Content.Server.AI.EntitySystems
{
public sealed class GoToPuddleSystem : EntitySystem
{
[Dependency] private readonly EntityLookupSystem _lookup = default!;
public EntityUid GetNearbyPuddle(EntityUid cleanbot, float range = 10)
{
foreach (var entity in _lookup.GetEntitiesInRange(cleanbot, range))
{
if (HasComp<PuddleComponent>(entity))
return entity;
}
return default;
}
}
}