]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix microwave construction (#30232)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Sun, 21 Jul 2024 16:20:09 +0000 (18:20 +0200)
committerGitHub <noreply@github.com>
Sun, 21 Jul 2024 16:20:09 +0000 (12:20 -0400)
* fix microwave construction

* retry

Content.Server/Kitchen/Components/MicrowaveComponent.cs
Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs

index 1d26f68cae89be05ff9c93c04228d44240a888bb..5337d80fd17bf69a58a72c53b409628fd16d21a6 100644 (file)
@@ -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;
 
index 71986ae859e9a86d47c805bb025b181a67ea7d74..98c875e773525046102ff25206abc096b0a63c65 100644 (file)
@@ -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();