From d5bdada430df06eccd3b72a6f46ff90726421446 Mon Sep 17 00:00:00 2001 From: slarticodefast <161409025+slarticodefast@users.noreply.github.com> Date: Sun, 21 Jul 2024 18:20:09 +0200 Subject: [PATCH] fix microwave construction (#30232) * fix microwave construction * retry --- Content.Server/Kitchen/Components/MicrowaveComponent.cs | 3 +++ Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Content.Server/Kitchen/Components/MicrowaveComponent.cs b/Content.Server/Kitchen/Components/MicrowaveComponent.cs index 1d26f68cae..5337d80fd1 100644 --- a/Content.Server/Kitchen/Components/MicrowaveComponent.cs +++ b/Content.Server/Kitchen/Components/MicrowaveComponent.cs @@ -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; diff --git a/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs b/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs index 71986ae859..98c875e773 100644 --- a/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs +++ b/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs @@ -252,7 +252,7 @@ namespace Content.Server.Kitchen.EntitySystems private void OnInit(Entity ent, ref ComponentInit args) { // this really does have to be in ComponentInit - ent.Comp.Storage = _container.EnsureContainer(ent, "microwave_entity_container"); + ent.Comp.Storage = _container.EnsureContainer(ent, ent.Comp.ContainerId); } private void OnMapInit(Entity ent, ref MapInitEvent args) @@ -312,6 +312,9 @@ namespace Content.Server.Kitchen.EntitySystems private void OnInsertAttempt(Entity ent, ref ContainerIsInsertingAttemptEvent args) { + if (args.Container.ID != ent.Comp.ContainerId) + return; + if (ent.Comp.Broken) { args.Cancel();