Computer and machine parts are only created on map init now.
Fixes #3795
This commit is contained in:
@@ -28,13 +28,6 @@ namespace Content.Server.GameObjects.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Startup()
|
|
||||||
{
|
|
||||||
base.Startup();
|
|
||||||
|
|
||||||
CreateComputerBoard();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void HandleMessage(ComponentMessage message, IComponent? component)
|
public override void HandleMessage(ComponentMessage message, IComponent? component)
|
||||||
{
|
{
|
||||||
base.HandleMessage(message, component);
|
base.HandleMessage(message, component);
|
||||||
|
|||||||
@@ -23,15 +23,8 @@ namespace Content.Server.GameObjects.Components.Construction
|
|||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
_boardContainer = ContainerHelpers.EnsureContainer<Container>(Owner, MachineFrameComponent.BoardContainer);
|
_boardContainer = Owner.EnsureContainer<Container>(MachineFrameComponent.BoardContainer);
|
||||||
_partContainer = ContainerHelpers.EnsureContainer<Container>(Owner, MachineFrameComponent.PartContainer);
|
_partContainer = Owner.EnsureContainer<Container>(MachineFrameComponent.PartContainer);
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Startup()
|
|
||||||
{
|
|
||||||
base.Startup();
|
|
||||||
|
|
||||||
CreateBoardAndStockParts();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<MachinePartComponent> GetAllParts()
|
public IEnumerable<MachinePartComponent> GetAllParts()
|
||||||
@@ -54,8 +47,8 @@ namespace Content.Server.GameObjects.Components.Construction
|
|||||||
public void CreateBoardAndStockParts()
|
public void CreateBoardAndStockParts()
|
||||||
{
|
{
|
||||||
// Entity might not be initialized yet.
|
// Entity might not be initialized yet.
|
||||||
var boardContainer = ContainerHelpers.EnsureContainer<Container>(Owner, MachineFrameComponent.BoardContainer, out var existedBoard);
|
var boardContainer = Owner.EnsureContainer<Container>(MachineFrameComponent.BoardContainer, out var existedBoard);
|
||||||
var partContainer = ContainerHelpers.EnsureContainer<Container>(Owner, MachineFrameComponent.PartContainer, out var existedParts);
|
var partContainer = Owner.EnsureContainer<Container>(MachineFrameComponent.PartContainer, out var existedParts);
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(BoardPrototype))
|
if (string.IsNullOrEmpty(BoardPrototype))
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user