ECS and cleanup body system, merge body templates and presets into body prototypes (#11991)
Co-authored-by: Jezithyr <Jezithyr@gmail.com>
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
using Content.Server.Body.Systems;
|
||||
using Content.Server.Morgue.Components;
|
||||
using Content.Shared.Standing;
|
||||
using Content.Server.Storage.Components;
|
||||
using Content.Shared.Body.Components;
|
||||
using Content.Shared.Standing;
|
||||
|
||||
namespace Content.Server.Morgue;
|
||||
|
||||
public sealed class EntityStorageLayingDownOverrideSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly StandingStateSystem _standing = default!;
|
||||
[Dependency] private readonly BodySystem _body = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -16,10 +18,11 @@ public sealed class EntityStorageLayingDownOverrideSystem : EntitySystem
|
||||
SubscribeLocalEvent<EntityStorageLayingDownOverrideComponent, StorageBeforeCloseEvent>(OnBeforeClose);
|
||||
}
|
||||
|
||||
private void OnBeforeClose(EntityUid uid, EntityStorageLayingDownOverrideComponent component, StorageBeforeCloseEvent args)
|
||||
private void OnBeforeClose(EntityUid uid, EntityStorageLayingDownOverrideComponent component,
|
||||
StorageBeforeCloseEvent args)
|
||||
{
|
||||
foreach (var ent in args.Contents)
|
||||
if (HasComp<SharedBodyComponent>(ent) && !_standing.IsDown(ent))
|
||||
if (HasComp<BodyComponent>(ent) && !_standing.IsDown(ent))
|
||||
args.Contents.Remove(ent);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user