diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs index eb21662719..3328563116 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs @@ -285,18 +285,18 @@ public sealed partial class AdminVerbSystem { Text = "admin-smite-remove-hands-name", Category = VerbCategory.Smite, - Icon = new SpriteSpecifier.Rsi(new ("/Textures/Fluids/vomit_toxin.rsi"), "vomit_toxin-1"), + Icon = new SpriteSpecifier.Rsi(new("/Textures/Fluids/vomit_toxin.rsi"), "vomit_toxin-1"), Act = () => { _vomitSystem.Vomit(args.Target, -1000, -1000); // You feel hollow! - var organs = _bodySystem.GetBodyOrganComponents(args.Target, body); + var organs = _bodySystem.GetBodyOrganEntityComps((args.Target, body)); var baseXform = Transform(args.Target); - foreach (var (xform, organ) in organs) + foreach (var organ in organs) { - if (HasComp(xform.Owner) || HasComp(xform.Owner)) + if (HasComp(organ.Owner) || HasComp(organ.Owner)) continue; - _transformSystem.AttachToGridOrMap(organ.Owner); + _transformSystem.PlaceNextTo((organ.Owner, organ.Comp1), (args.Target, baseXform)); } _popupSystem.PopupEntity(Loc.GetString("admin-smite-vomit-organs-self"), args.Target, diff --git a/Content.Shared/Body/Systems/SharedBodySystem.Organs.cs b/Content.Shared/Body/Systems/SharedBodySystem.Organs.cs index efabebfc85..30fed573b8 100644 --- a/Content.Shared/Body/Systems/SharedBodySystem.Organs.cs +++ b/Content.Shared/Body/Systems/SharedBodySystem.Organs.cs @@ -183,6 +183,30 @@ public partial class SharedBodySystem return list; } + /// + /// Returns a list of Entity<, > + /// for each organ of the body + /// + /// The component that we want to return + /// The body to check the organs of + public List> GetBodyOrganEntityComps( + Entity entity) + where T : IComponent + { + if (!Resolve(entity, ref entity.Comp)) + return new List>(); + + var query = GetEntityQuery(); + var list = new List>(3); + foreach (var organ in GetBodyOrgans(entity.Owner, entity.Comp)) + { + if (query.TryGetComponent(organ.Id, out var comp)) + list.Add((organ.Id, comp, organ.Component)); + } + + return list; + } + /// /// Tries to get a list of ValueTuples of and OrganComponent on each organs /// in the given body.