Disable interactions for entities in storage
This commit is contained in:
@@ -212,6 +212,11 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
||||
|
||||
private bool AddToContents(IEntity entity)
|
||||
{
|
||||
if (!entity.HasComponent<InEntityStorageComponent>())
|
||||
{
|
||||
entity.AddComponent<InEntityStorageComponent>();
|
||||
}
|
||||
|
||||
var collidableComponent = Owner.GetComponent<ICollidableComponent>();
|
||||
ICollidableComponent entityCollidableComponent;
|
||||
if (entity.TryGetComponent(out entityCollidableComponent))
|
||||
@@ -273,6 +278,11 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
||||
{
|
||||
entityCollidableComponent.CanCollide = true;
|
||||
}
|
||||
|
||||
if (contained.HasComponent<InEntityStorageComponent>())
|
||||
{
|
||||
contained.RemoveComponent<InEntityStorageComponent>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -407,6 +417,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
||||
|
||||
public void OnDestroy(DestructionEventArgs eventArgs)
|
||||
{
|
||||
Open = true;
|
||||
EmptyContents();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user