diff --git a/Content.Server/GameObjects/Components/ComputerComponent.cs b/Content.Server/GameObjects/Components/ComputerComponent.cs index 9757f0ae90..2c29115f14 100644 --- a/Content.Server/GameObjects/Components/ComputerComponent.cs +++ b/Content.Server/GameObjects/Components/ComputerComponent.cs @@ -65,6 +65,10 @@ namespace Content.Server.GameObjects.Components /// private void CreateComputerBoard() { + // Ensure that the construction component is aware of the board container. + if (Owner.TryGetComponent(out ConstructionComponent construction)) + construction.AddContainer("board"); + // We don't do anything if this is null or empty. if (string.IsNullOrEmpty(_boardPrototype)) return; @@ -82,9 +86,6 @@ namespace Content.Server.GameObjects.Components if(!container.Insert(board)) Logger.Warning($"Couldn't insert board {board} to computer {Owner}!"); - - if (Owner.TryGetComponent(out ConstructionComponent construction)) - construction.AddContainer("board"); } public void MapInit() diff --git a/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs b/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs index 678fe75f28..c7dec64e04 100644 --- a/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs +++ b/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs @@ -419,7 +419,7 @@ namespace Content.Server.GameObjects.Components.Construction { foreach (var container in _containers) { - var otherContainer = ContainerHelpers.EnsureContainer(entity, container); + var otherContainer = entity.EnsureContainer(container); var ourContainer = containerComp.GetContainer(container); foreach (var ent in ourContainer.ContainedEntities.ToArray()) diff --git a/Resources/Changelog/Parts/computer_boards.yml b/Resources/Changelog/Parts/computer_boards.yml new file mode 100644 index 0000000000..98254f3335 --- /dev/null +++ b/Resources/Changelog/Parts/computer_boards.yml @@ -0,0 +1,4 @@ +author: Zumorica +changes: + - type: Fix # One of the following: Add, Remove, Tweak, Fix + message: Fixes bug where deconstructing computers wouldn't return the circuit board.