From 0ad70d62ec650c54b335fa02f370d36394495200 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Mon, 8 Mar 2021 14:51:15 +1100 Subject: [PATCH] Fix item dropping into disposals (#3578) Co-authored-by: Metal Gear Sloth --- .../Components/Disposal/DisposalUnitComponent.cs | 15 --------------- .../Disposal/SharedDisposalUnitComponent.cs | 16 +++++++++------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/Content.Server/GameObjects/Components/Disposal/DisposalUnitComponent.cs b/Content.Server/GameObjects/Components/Disposal/DisposalUnitComponent.cs index 40c613ed07..d31c3d85ce 100644 --- a/Content.Server/GameObjects/Components/Disposal/DisposalUnitComponent.cs +++ b/Content.Server/GameObjects/Components/Disposal/DisposalUnitComponent.cs @@ -145,21 +145,6 @@ namespace Content.Server.GameObjects.Components.Disposal if (!base.CanInsert(entity)) return false; - if (!entity.TryGetComponent(out IPhysBody? physics) || - !physics.CanCollide) - { - if (entity.TryGetComponent(out IMobStateComponent? state) && state.IsDead()) - { - return false; - } - } - - if (!entity.HasComponent() && - !entity.HasComponent()) - { - return false; - } - return _container.CanInsert(entity); } diff --git a/Content.Shared/GameObjects/Components/Disposal/SharedDisposalUnitComponent.cs b/Content.Shared/GameObjects/Components/Disposal/SharedDisposalUnitComponent.cs index afb3ee6804..f6923370ad 100644 --- a/Content.Shared/GameObjects/Components/Disposal/SharedDisposalUnitComponent.cs +++ b/Content.Shared/GameObjects/Components/Disposal/SharedDisposalUnitComponent.cs @@ -167,20 +167,22 @@ namespace Content.Shared.GameObjects.Components.Disposal if (!Anchored) return false; + // TODO: Probably just need a disposable tag. + if (!entity.TryGetComponent(out SharedStorableComponent? storable) && + !entity.HasComponent()) + { + return false; + } + + if (!entity.TryGetComponent(out IPhysBody? physics) || - !physics.CanCollide) + !physics.CanCollide && storable == null) { if (!(entity.TryGetComponent(out IMobStateComponent? damageState) && damageState.IsDead())) { return false; } } - if (!entity.HasComponent() && - !entity.HasComponent()) - { - return false; - } - return true; }