diff --git a/Content.Server/Construction/ConstructionSystem.Graph.cs b/Content.Server/Construction/ConstructionSystem.Graph.cs index 43b7b009a5..5d4bcde4ce 100644 --- a/Content.Server/Construction/ConstructionSystem.Graph.cs +++ b/Content.Server/Construction/ConstructionSystem.Graph.cs @@ -324,11 +324,17 @@ namespace Content.Server.Construction } } - // We set the graph and node accordingly. - ChangeGraph(newUid, userUid, construction.Graph, construction.Node, false, newConstruction); + // If the new entity has the *same* construction graph, stay on the same node. + // If not, we effectively restart the construction graph, so the new entity can be completed. + if (construction.Graph == newConstruction.Graph) + { + ChangeNode(newUid, userUid, construction.Node, false, newConstruction); - if (construction.TargetNode is {} targetNode) - SetPathfindingTarget(newUid, targetNode, newConstruction); + // Retain the target node if an entity change happens in response to deconstruction; + // in that case, we must continue to move towards the start node. + if (construction.TargetNode is {} targetNode) + SetPathfindingTarget(newUid, targetNode, newConstruction); + } // Transfer all pending interaction events too. while (construction.InteractionQueue.TryDequeue(out var ev))