Fix item dropping into disposals (#3578)
Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
@@ -145,21 +145,6 @@ namespace Content.Server.GameObjects.Components.Disposal
|
|||||||
if (!base.CanInsert(entity))
|
if (!base.CanInsert(entity))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!entity.TryGetComponent(out IPhysBody? physics) ||
|
|
||||||
!physics.CanCollide)
|
|
||||||
{
|
|
||||||
if (entity.TryGetComponent(out IMobStateComponent? state) && state.IsDead())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!entity.HasComponent<ItemComponent>() &&
|
|
||||||
!entity.HasComponent<IBody>())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return _container.CanInsert(entity);
|
return _container.CanInsert(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -167,20 +167,22 @@ namespace Content.Shared.GameObjects.Components.Disposal
|
|||||||
if (!Anchored)
|
if (!Anchored)
|
||||||
return false;
|
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) ||
|
if (!entity.TryGetComponent(out IPhysBody? physics) ||
|
||||||
!physics.CanCollide)
|
!physics.CanCollide && storable == null)
|
||||||
{
|
{
|
||||||
if (!(entity.TryGetComponent(out IMobStateComponent? damageState) && damageState.IsDead())) {
|
if (!(entity.TryGetComponent(out IMobStateComponent? damageState) && damageState.IsDead())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!entity.HasComponent<SharedStorableComponent>() &&
|
|
||||||
!entity.HasComponent<IBody>())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user