mirror of
https://github.com/space-wizards/space-station-14.git
synced 2026-02-14 19:29:53 +01:00
* Nubody * fix test fails * gibbing * lung test returns * doc comment * hand organ test * giblet test * yaml formatting * returning * relocate * trimming * re-smite * oops thusd tweak * arachnids have slower metabolism i guess * never mind the old behaviour is bad actually * rider whyyy * style changes and allat * fix collision --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
21 lines
606 B
C#
21 lines
606 B
C#
namespace Content.Shared.Body;
|
|
|
|
public sealed partial class BodySystem
|
|
{
|
|
[Obsolete("Use an event-relay based approach instead")]
|
|
public bool TryGetOrgansWithComponent<TComp>(Entity<BodyComponent?> ent, out List<Entity<TComp>> organs) where TComp : Component
|
|
{
|
|
organs = new();
|
|
if (!_bodyQuery.Resolve(ent, ref ent.Comp))
|
|
return false;
|
|
|
|
foreach (var organ in ent.Comp.Organs?.ContainedEntities ?? [])
|
|
{
|
|
if (TryComp<TComp>(organ, out var comp))
|
|
organs.Add((organ, comp));
|
|
}
|
|
|
|
return organs.Count != 0;
|
|
}
|
|
}
|