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:
DrSmugleaf
2022-10-23 00:46:28 +02:00
committed by GitHub
parent 9a38736c3c
commit f323fb7644
140 changed files with 2478 additions and 2571 deletions

View File

@@ -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);
}
}