Fixes bug where computers wouldn't return the circuit board when deconstructed.
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -419,7 +419,7 @@ namespace Content.Server.GameObjects.Components.Construction
|
||||
{
|
||||
foreach (var container in _containers)
|
||||
{
|
||||
var otherContainer = ContainerHelpers.EnsureContainer<Container>(entity, container);
|
||||
var otherContainer = entity.EnsureContainer<Container>(container);
|
||||
var ourContainer = containerComp.GetContainer(container);
|
||||
|
||||
foreach (var ent in ourContainer.ContainedEntities.ToArray())
|
||||
|
||||
Reference in New Issue
Block a user