From c39f0fb72182675540d8569eae273e21b13b0618 Mon Sep 17 00:00:00 2001 From: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com> Date: Sat, 13 Mar 2021 04:59:19 -0800 Subject: [PATCH] Fix edge.completed not getting run if node.action deletes (#3652) --- .../Construction/ConstructionComponent.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs b/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs index fcce69485e..af1a685a87 100644 --- a/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs +++ b/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable using System; using System.Collections.Generic; using System.IO; @@ -357,6 +357,12 @@ namespace Content.Server.GameObjects.Components.Construction Edge = null; Node = GraphPrototype.Nodes[edge.Target]; + foreach (var completed in edge.Completed) + { + await completed.PerformAction(Owner, user); + if (Owner.Deleted) return true; + } + // Perform node actions! foreach (var action in Node.Actions) { @@ -369,12 +375,6 @@ namespace Content.Server.GameObjects.Components.Construction if (Target == Node) ClearTarget(); - foreach (var completed in edge.Completed) - { - await completed.PerformAction(Owner, user); - if (Owner.Deleted) return true; - } - await HandleEntityChange(Node, user); return true;