From fdf663342e09b8a56273557c20b292e11ff6943f Mon Sep 17 00:00:00 2001 From: Vera Aguilera Puerto Date: Sun, 4 Apr 2021 20:51:26 +0200 Subject: [PATCH] Fixes crash when computer prototype doesn't have a container manager but specifies a board prototype --- Content.Server/GameObjects/Components/ComputerComponent.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Content.Server/GameObjects/Components/ComputerComponent.cs b/Content.Server/GameObjects/Components/ComputerComponent.cs index 4a1ce95bc2..8bb647de19 100644 --- a/Content.Server/GameObjects/Components/ComputerComponent.cs +++ b/Content.Server/GameObjects/Components/ComputerComponent.cs @@ -21,6 +21,9 @@ namespace Content.Server.GameObjects.Components { base.Initialize(); + // Let's ensure the container manager and container are here. + Owner.EnsureContainer("board", out var _); + if (Owner.TryGetComponent(out PowerReceiverComponent? powerReceiver) && Owner.TryGetComponent(out AppearanceComponent? appearance)) { @@ -62,7 +65,7 @@ namespace Content.Server.GameObjects.Components if (string.IsNullOrEmpty(_boardPrototype)) return; - var container = ContainerHelpers.EnsureContainer(Owner, "board", out var existed); + var container = Owner.EnsureContainer("board", out var existed); if (existed) {