Fixes bug where computers wouldn't return the circuit board when deconstructed.

This commit is contained in:
Vera Aguilera Puerto
2021-03-06 14:45:14 +01:00
parent d87bc211d5
commit 7f3b944500
3 changed files with 9 additions and 4 deletions

View File

@@ -65,6 +65,10 @@ namespace Content.Server.GameObjects.Components
/// </summary>
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()