From 7dd4dca2eddc956904fd13a29067628956ea506a Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Mon, 7 May 2018 11:15:12 +0300 Subject: [PATCH] Fixed crashing when a round starts if the sub has been saved while a fabricator was running. Closes #398 --- .../Source/Items/Components/Machines/Fabricator.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Barotrauma/BarotraumaShared/Source/Items/Components/Machines/Fabricator.cs b/Barotrauma/BarotraumaShared/Source/Items/Components/Machines/Fabricator.cs index 7a1e32758..4c553b0ef 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Components/Machines/Fabricator.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Components/Machines/Fabricator.cs @@ -241,6 +241,12 @@ namespace Barotrauma.Items.Components public override void Update(float deltaTime, Camera cam) { + if (fabricatedItem == null) + { + CancelFabricating(); + return; + } + #if CLIENT if (progressBar != null) {