fix microwave construction (#30232)
* fix microwave construction * retry
This commit is contained in:
parent
b68bbfc939
commit
dcc885d65c
|
|
@ -79,6 +79,9 @@ namespace Content.Server.Kitchen.Components
|
|||
|
||||
public Container Storage = default!;
|
||||
|
||||
[DataField]
|
||||
public string ContainerId = "microwave_entity_container";
|
||||
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public int Capacity = 10;
|
||||
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ namespace Content.Server.Kitchen.EntitySystems
|
|||
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)
|
||||
|
|
@ -312,6 +312,9 @@ namespace Content.Server.Kitchen.EntitySystems
|
|||
|
||||
private void OnInsertAttempt(Entity<MicrowaveComponent> ent, ref ContainerIsInsertingAttemptEvent args)
|
||||
{
|
||||
if (args.Container.ID != ent.Comp.ContainerId)
|
||||
return;
|
||||
|
||||
if (ent.Comp.Broken)
|
||||
{
|
||||
args.Cancel();
|
||||
|
|
|
|||
Loading…
Reference in New Issue