public Container Storage = default!;
+ [DataField]
+ public string ContainerId = "microwave_entity_container";
+
[DataField, ViewVariables(VVAccess.ReadWrite)]
public int Capacity = 10;
private void OnInit(Entity<MicrowaveComponent> ent, ref ComponentInit args)
{
// this really does have to be in ComponentInit
- ent.Comp.Storage = _container.EnsureContainer<Container>(ent, "microwave_entity_container");
+ ent.Comp.Storage = _container.EnsureContainer<Container>(ent, ent.Comp.ContainerId);
}
private void OnMapInit(Entity<MicrowaveComponent> ent, ref MapInitEvent args)
private void OnInsertAttempt(Entity<MicrowaveComponent> ent, ref ContainerIsInsertingAttemptEvent args)
{
+ if (args.Container.ID != ent.Comp.ContainerId)
+ return;
+
if (ent.Comp.Broken)
{
args.Cancel();