diff --git a/Content.Server/Glue/GlueSystem.cs b/Content.Server/Glue/GlueSystem.cs index 2b7f0060bc..9409a423c4 100644 --- a/Content.Server/Glue/GlueSystem.cs +++ b/Content.Server/Glue/GlueSystem.cs @@ -99,7 +99,8 @@ public sealed class GlueSystem : SharedGlueSystem private void OnHandPickUp(Entity entity, ref GotEquippedHandEvent args) { - EnsureComp(entity); + var comp = EnsureComp(entity); + comp.DeleteOnDrop = false; entity.Comp.Until = _timing.CurTime + entity.Comp.Duration; } } diff --git a/Content.Server/Resist/EscapeInventorySystem.cs b/Content.Server/Resist/EscapeInventorySystem.cs index 1249269de5..56e0684aae 100644 --- a/Content.Server/Resist/EscapeInventorySystem.cs +++ b/Content.Server/Resist/EscapeInventorySystem.cs @@ -41,6 +41,13 @@ public sealed class EscapeInventorySystem : EntitySystem if (!_containerSystem.TryGetContainingContainer(uid, out var container) || !_actionBlockerSystem.CanInteract(uid, container.Owner)) return; + // Make sure there's nothing stopped the removal (like being glued) + if (!_containerSystem.CanRemove(uid, container)) + { + _popupSystem.PopupEntity(Loc.GetString("escape-inventory-component-failed-resisting"), uid, uid); + return; + } + // Contested if (_handsSystem.IsHolding(container.Owner, uid, out var inHand)) { @@ -53,7 +60,10 @@ public sealed class EscapeInventorySystem : EntitySystem contestResults = 1; if (contestResults >= MaximumMassDisadvantage) + { + _popupSystem.PopupEntity(Loc.GetString("escape-inventory-component-failed-resisting"), uid, uid); return; + } AttemptEscape(uid, container.Owner, component, contestResults); return; @@ -80,7 +90,6 @@ public sealed class EscapeInventorySystem : EntitySystem if (!_doAfterSystem.TryStartDoAfter(doAfterEventArgs, out component.DoAfter)) return; - Dirty(user, component); _popupSystem.PopupEntity(Loc.GetString("escape-inventory-component-start-resisting"), user, user); _popupSystem.PopupEntity(Loc.GetString("escape-inventory-component-start-resisting-target"), container, container); } @@ -88,7 +97,6 @@ public sealed class EscapeInventorySystem : EntitySystem private void OnEscape(EntityUid uid, CanEscapeInventoryComponent component, EscapeInventoryEvent args) { component.DoAfter = null; - Dirty(uid, component); if (args.Handled || args.Cancelled) return; diff --git a/Resources/Locale/en-US/resist/components/escape-inventory-component.ftl b/Resources/Locale/en-US/resist/components/escape-inventory-component.ftl index d5d681626f..b99ce327be 100644 --- a/Resources/Locale/en-US/resist/components/escape-inventory-component.ftl +++ b/Resources/Locale/en-US/resist/components/escape-inventory-component.ftl @@ -1,2 +1,3 @@ escape-inventory-component-start-resisting = You start struggling to escape! escape-inventory-component-start-resisting-target = Something is struggling to get out of your inventory! +escape-inventory-component-failed-resisting = Can't escape!