From: Łukasz Mędrek Date: Sat, 27 Apr 2024 06:30:29 +0000 (+0000) Subject: fix: deconstruct verb on undeconstructables (#27387) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=8442a9142c28917553fb35c6e63695fcbfc62fe2;p=space-station-14.git fix: deconstruct verb on undeconstructables (#27387) Some of prototypes don't specify their deconstructTarget node, which made them show the deconstruct verb as deconstructTarget is set to "start" node by default. This patch makes attempt to check if is it even possible from current construction node to reach specified deconstructTarget. Fixes #27330 --- diff --git a/Content.Server/Construction/ConstructionSystem.Guided.cs b/Content.Server/Construction/ConstructionSystem.Guided.cs index fe7f9152c0..e096bc02c3 100644 --- a/Content.Server/Construction/ConstructionSystem.Guided.cs +++ b/Content.Server/Construction/ConstructionSystem.Guided.cs @@ -41,6 +41,18 @@ namespace Content.Server.Construction component.Node == component.DeconstructionNode) return; + if (!_prototypeManager.TryIndex(component.Graph, out ConstructionGraphPrototype? graph)) + return; + + if (component.DeconstructionNode == null) + return; + + if (GetCurrentNode(uid, component) is not {} currentNode) + return; + + if (graph.Path(currentNode.Name, component.DeconstructionNode) is not {} path || path.Length == 0) + return; + Verb verb = new(); //verb.Category = VerbCategories.Construction; //TODO VERBS add more construction verbs? Until then, removing construction category