From: slarticodefast <161409025+slarticodefast@users.noreply.github.com> Date: Sun, 21 Jul 2024 16:20:09 +0000 (+0200) Subject: fix microwave construction (#30232) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=d5bdada430df06eccd3b72a6f46ff90726421446;p=space-station-14.git fix microwave construction (#30232) * fix microwave construction * retry --- 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();