2021-06-09 22:19:39 +02:00
|
|
|
using Content.Server.Storage.Components;
|
|
|
|
|
using Content.Shared.Body.Components;
|
|
|
|
|
using Content.Shared.Interaction;
|
2021-06-27 19:02:46 +10:00
|
|
|
using Content.Shared.Standing;
|
2020-10-28 22:51:43 +00:00
|
|
|
using Robust.Shared.GameObjects;
|
2021-12-03 12:23:18 +01:00
|
|
|
using Robust.Shared.IoC;
|
2020-10-28 22:51:43 +00:00
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.Morgue.Components
|
2020-10-28 22:51:43 +00:00
|
|
|
{
|
|
|
|
|
[RegisterComponent]
|
|
|
|
|
[ComponentReference(typeof(EntityStorageComponent))]
|
|
|
|
|
[ComponentReference(typeof(IActivate))]
|
|
|
|
|
[ComponentReference(typeof(IStorageComponent))]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class BodyBagEntityStorageComponent : EntityStorageComponent
|
2020-10-28 22:51:43 +00:00
|
|
|
{
|
2021-12-05 18:09:01 +01:00
|
|
|
protected override bool AddToContents(EntityUid entity)
|
2020-10-28 22:51:43 +00:00
|
|
|
{
|
2021-12-05 18:09:01 +01:00
|
|
|
if (IoCManager.Resolve<IEntityManager>().HasComponent<SharedBodyComponent>(entity) && !EntitySystem.Get<StandingStateSystem>().IsDown(entity)) return false;
|
2020-10-28 22:51:43 +00:00
|
|
|
return base.AddToContents(entity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|