Fix item dropping into disposals (#3578)

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2021-03-08 14:51:15 +11:00
committed by GitHub
parent 4b8e4dd6ba
commit 0ad70d62ec
2 changed files with 9 additions and 22 deletions

View File

@@ -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<IBody>())
{
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<SharedStorableComponent>() &&
!entity.HasComponent<IBody>())
{
return false;
}
return true;
}