From e4261f4e5757f2de3440210ee6b4e1ca4c11c50a Mon Sep 17 00:00:00 2001 From: Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com> Date: Fri, 30 Oct 2020 02:06:20 +0200 Subject: [PATCH] Make dead bodies disposable (#2375) * Make dead bodies disposable * Formatting Fixes * Fixed Returning False in any case * Revert "Fixed Returning False in any case" This reverts commit fb1e40ca44f208078816e119976779280922b4c8. * Fixed Returning False in any case * Update Submodule --- .../Components/Disposal/DisposalUnitComponent.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Content.Server/GameObjects/Components/Disposal/DisposalUnitComponent.cs b/Content.Server/GameObjects/Components/Disposal/DisposalUnitComponent.cs index e6c9bd7389..bad4e0baaf 100644 --- a/Content.Server/GameObjects/Components/Disposal/DisposalUnitComponent.cs +++ b/Content.Server/GameObjects/Components/Disposal/DisposalUnitComponent.cs @@ -6,12 +6,14 @@ using System.Threading; using System.Threading.Tasks; using Content.Server.GameObjects.Components.GUI; using Content.Server.GameObjects.Components.Items.Storage; +using Content.Server.GameObjects.Components.Mobs.State; using Content.Server.GameObjects.Components.Power.ApcNetComponents; using Content.Server.GameObjects.Components.Projectiles; using Content.Server.GameObjects.EntitySystems.DoAfter; using Content.Server.Interfaces.GameObjects.Components.Items; using Content.Server.Utility; using Content.Shared.GameObjects.Components.Body; +using Content.Shared.GameObjects.Components.Damage; using Content.Shared.GameObjects.Components.Disposal; using Content.Shared.GameObjects.Components.Items; using Content.Shared.GameObjects.EntitySystems; @@ -136,10 +138,13 @@ namespace Content.Server.GameObjects.Components.Disposal return false; } - if (!entity.TryGetComponent(out IPhysicsComponent? physics) || + + if (!entity.TryGetComponent(out IPhysicsComponent? physics) || !physics.CanCollide) { - return false; + if (!(entity.TryGetComponent(out IDamageableComponent? damageState) && damageState.CurrentState == DamageState.Dead)) { + return false; + } } if (!entity.HasComponent() &&