]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix unremovable items used in construction (#37292)
authorErrant <35878406+Errant-4@users.noreply.github.com>
Fri, 9 May 2025 12:43:38 +0000 (14:43 +0200)
committerGitHub <noreply@github.com>
Fri, 9 May 2025 12:43:38 +0000 (15:43 +0300)
Content.Server/Construction/ConstructionSystem.Interactions.cs

index 426ab6e80fb942f35bed8947487cf75765e69062..70a66c0ec7c5f9d9c86a3f9b148dd8c82262eb9c 100644 (file)
@@ -8,8 +8,10 @@ using Content.Shared.Construction.EntitySystems;
 using Content.Shared.Construction.Steps;
 using Content.Shared.DoAfter;
 using Content.Shared.Interaction;
+using Content.Shared.Interaction.Components;
 using Content.Shared.Prying.Systems;
 using Content.Shared.Radio.EntitySystems;
+using Content.Shared.Stacks;
 using Content.Shared.Temperature;
 using Content.Shared.Tools.Systems;
 using Robust.Shared.Containers;
@@ -274,6 +276,10 @@ namespace Content.Server.Construction
                     if(!insertStep.EntityValid(insert, EntityManager, _factory))
                         return HandleResult.False;
 
+                    // Unremovable items can't be inserted, unless they are a lingering stack
+                    if(HasComp<UnremoveableComponent>(insert) && (!TryComp<StackComponent>(insert, out var comp) || !comp.Lingering))
+                        return HandleResult.False;
+
                     // If we're only testing whether this step would be handled by the given event, then we're done.
                     if (validation)
                         return HandleResult.Validated;