fix unremovable items used in construction (#37292)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user