Replace InEntityStorageComponent with in container check
This commit is contained in:
@@ -120,16 +120,6 @@ namespace Content.Server.GameObjects.Components
|
|||||||
serializer.DataField(this, a => a.CanWeldShut, "CanWeldShut", true);
|
serializer.DataField(this, a => a.CanWeldShut, "CanWeldShut", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Shutdown()
|
|
||||||
{
|
|
||||||
base.Shutdown();
|
|
||||||
|
|
||||||
foreach (var entity in _contents.ContainedEntities)
|
|
||||||
{
|
|
||||||
entity.RemoveComponent<InEntityStorageComponent>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void Activate(ActivateEventArgs eventArgs)
|
public virtual void Activate(ActivateEventArgs eventArgs)
|
||||||
{
|
{
|
||||||
ToggleOpen(eventArgs.User);
|
ToggleOpen(eventArgs.User);
|
||||||
@@ -224,8 +214,6 @@ namespace Content.Server.GameObjects.Components
|
|||||||
|
|
||||||
private bool AddToContents(IEntity entity)
|
private bool AddToContents(IEntity entity)
|
||||||
{
|
{
|
||||||
entity.EnsureComponent<InEntityStorageComponent>();
|
|
||||||
|
|
||||||
var collidableComponent = Owner.GetComponent<ICollidableComponent>();
|
var collidableComponent = Owner.GetComponent<ICollidableComponent>();
|
||||||
ICollidableComponent entityCollidableComponent;
|
ICollidableComponent entityCollidableComponent;
|
||||||
if (entity.TryGetComponent(out entityCollidableComponent))
|
if (entity.TryGetComponent(out entityCollidableComponent))
|
||||||
@@ -287,11 +275,6 @@ namespace Content.Server.GameObjects.Components
|
|||||||
{
|
{
|
||||||
entityCollidableComponent.CanCollide = true;
|
entityCollidableComponent.CanCollide = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (contained.HasComponent<InEntityStorageComponent>())
|
|
||||||
{
|
|
||||||
contained.RemoveComponent<InEntityStorageComponent>();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
using Content.Shared.GameObjects.EntitySystems;
|
|
||||||
using Robust.Shared.GameObjects;
|
|
||||||
|
|
||||||
namespace Content.Server.GameObjects.Components.Items.Storage
|
|
||||||
{
|
|
||||||
[RegisterComponent]
|
|
||||||
public class InEntityStorageComponent : Component, IActionBlocker
|
|
||||||
{
|
|
||||||
public override string Name => "InEntityStorage";
|
|
||||||
|
|
||||||
public bool CanInteract()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -13,6 +13,7 @@ using JetBrains.Annotations;
|
|||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Server.GameObjects.EntitySystems;
|
using Robust.Server.GameObjects.EntitySystems;
|
||||||
using Robust.Server.Interfaces.Player;
|
using Robust.Server.Interfaces.Player;
|
||||||
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.GameObjects.Components;
|
using Robust.Shared.GameObjects.Components;
|
||||||
using Robust.Shared.Input;
|
using Robust.Shared.Input;
|
||||||
@@ -261,7 +262,8 @@ namespace Content.Server.GameObjects.EntitySystems.Click
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ActionBlockerSystem.CanInteract(player))
|
if (!ActionBlockerSystem.CanInteract(player) ||
|
||||||
|
ContainerHelpers.IsInContainer(player))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user