move lockcomponent to shared (#13722)

* move lockcomponent to shared

* ajcm review
This commit is contained in:
Nemanja
2023-02-11 20:12:29 -05:00
committed by GitHub
parent 301956ef15
commit c6c319f7e4
23 changed files with 381 additions and 332 deletions

View File

@@ -1,15 +1,13 @@
using Content.Server.Body.Systems;
using Content.Server.Morgue.Components;
using Content.Server.Storage.Components;
using Content.Shared.Body.Components;
using Content.Shared.Standing;
using Content.Shared.Storage.Components;
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()
{
@@ -18,11 +16,12 @@ 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, ref StorageBeforeCloseEvent args)
{
foreach (var ent in args.Contents)
{
if (HasComp<BodyComponent>(ent) && !_standing.IsDown(ent))
args.Contents.Remove(ent);
}
}
}