Add ContainerComp (#31311)

Applies EntProtoId changes upon insertion / removal from container. Can also be useful for borgs / mechs / vehicles in future but atm I just used it for AI.
This commit is contained in:
metalgearsloth
2024-08-25 22:06:06 +10:00
committed by GitHub
parent 7cb6b5e972
commit f03fc585ba
2 changed files with 61 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Shared.Containers;
/// <summary>
/// Applies container changes whenever an entity is inserted into the specified container on this entity.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class ContainerCompComponent : Component
{
[DataField(required: true)]
public EntProtoId Proto;
[DataField(required: true)]
public string Container = string.Empty;
}