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>
|
/// </summary>
|
||||||
private void CreateComputerBoard()
|
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.
|
// We don't do anything if this is null or empty.
|
||||||
if (string.IsNullOrEmpty(_boardPrototype))
|
if (string.IsNullOrEmpty(_boardPrototype))
|
||||||
return;
|
return;
|
||||||
@@ -82,9 +86,6 @@ namespace Content.Server.GameObjects.Components
|
|||||||
|
|
||||||
if(!container.Insert(board))
|
if(!container.Insert(board))
|
||||||
Logger.Warning($"Couldn't insert board {board} to computer {Owner}!");
|
Logger.Warning($"Couldn't insert board {board} to computer {Owner}!");
|
||||||
|
|
||||||
if (Owner.TryGetComponent(out ConstructionComponent construction))
|
|
||||||
construction.AddContainer("board");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MapInit()
|
public void MapInit()
|
||||||
|
|||||||
@@ -419,7 +419,7 @@ namespace Content.Server.GameObjects.Components.Construction
|
|||||||
{
|
{
|
||||||
foreach (var container in _containers)
|
foreach (var container in _containers)
|
||||||
{
|
{
|
||||||
var otherContainer = ContainerHelpers.EnsureContainer<Container>(entity, container);
|
var otherContainer = entity.EnsureContainer<Container>(container);
|
||||||
var ourContainer = containerComp.GetContainer(container);
|
var ourContainer = containerComp.GetContainer(container);
|
||||||
|
|
||||||
foreach (var ent in ourContainer.ContainedEntities.ToArray())
|
foreach (var ent in ourContainer.ContainedEntities.ToArray())
|
||||||
|
|||||||
4
Resources/Changelog/Parts/computer_boards.yml
Normal file
4
Resources/Changelog/Parts/computer_boards.yml
Normal file
@@ -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.
|
||||||
Reference in New Issue
Block a user