From d14b82a1e6d98d5fa4b62f08192bec3dec887d4f Mon Sep 17 00:00:00 2001 From: Paul Ritter Date: Sun, 1 Aug 2021 06:13:46 +0200 Subject: [PATCH] fixes morgue (almost) (#4375) * fixes morgue (almost) * yes Co-authored-by: Paul --- .../Components/MorgueEntityStorageComponent.cs | 16 ++++++++++++++++ .../Storage/Components/EntityStorageComponent.cs | 2 +- .../Entities/Structures/Storage/morgue.yml | 12 ++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/Content.Server/Morgue/Components/MorgueEntityStorageComponent.cs b/Content.Server/Morgue/Components/MorgueEntityStorageComponent.cs index 0699c6e19f..7f38b3807d 100644 --- a/Content.Server/Morgue/Components/MorgueEntityStorageComponent.cs +++ b/Content.Server/Morgue/Components/MorgueEntityStorageComponent.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using Content.Server.Storage.Components; using Content.Shared.Body.Components; using Content.Shared.Directions; @@ -12,6 +13,7 @@ using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Containers; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Localization; using Robust.Shared.Maths; using Robust.Shared.Player; @@ -132,6 +134,20 @@ namespace Content.Server.Morgue.Components } } + protected override IEnumerable DetermineCollidingEntities() + { + if (_tray == null) + { + yield break; + } + + var entityLookup = IoCManager.Resolve(); + foreach (var entity in entityLookup.GetEntitiesIntersecting(_tray)) + { + yield return entity; + } + } + //Called every 10 seconds public void Update() { diff --git a/Content.Server/Storage/Components/EntityStorageComponent.cs b/Content.Server/Storage/Components/EntityStorageComponent.cs index cbe6f9affd..9fb9e995e8 100644 --- a/Content.Server/Storage/Components/EntityStorageComponent.cs +++ b/Content.Server/Storage/Components/EntityStorageComponent.cs @@ -443,7 +443,7 @@ namespace Content.Server.Storage.Components EmptyContents(); } - protected IEnumerable DetermineCollidingEntities() + protected virtual IEnumerable DetermineCollidingEntities() { var entityLookup = IoCManager.Resolve(); return entityLookup.GetEntitiesIntersecting(Owner); diff --git a/Resources/Prototypes/Entities/Structures/Storage/morgue.yml b/Resources/Prototypes/Entities/Structures/Storage/morgue.yml index 92e4e35a4e..2415993a28 100644 --- a/Resources/Prototypes/Entities/Structures/Storage/morgue.yml +++ b/Resources/Prototypes/Entities/Structures/Storage/morgue.yml @@ -54,6 +54,18 @@ name: morgue tray description: If you lay down to have a rest on this, you'll soon have a problem. components: + - type: Physics + bodyType: Static + fixtures: + - shape: + !type:PhysShapeAabb + bounds: "-0.5, -0.5, 0.5, 0.5" + mass: 25 + mask: + - Impassable + - MobImpassable + - VaultImpassable + - SmallImpassable - type: Sprite netsync: false sprite: Structures/Storage/morgue.rsi