From e440c6fafa09ce7b34ba2e63f3e36a6ccbb45316 Mon Sep 17 00:00:00 2001 From: Sergi Rosell <50594106+srosellj@users.noreply.github.com> Date: Mon, 28 Sep 2026 19:32:01 +0200 Subject: [PATCH] fix: stealing no longer takes items out of a locked container (#2681) `TryStealItem` doesn't check for a locked container, so an item that can still be targeted inside one (the gump stays open when it gets locked, or the client targets by serial) is stolen without picking the lock. It now refuses with 501747 ("It appears to be locked."); GMs are exempt, and stealing the locked container itself is unchanged. It checks the lock directly rather than calling `CheckLift`, which would also refuse items in deco containers. --- Projects/UOContent/Skills/Stealing.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Projects/UOContent/Skills/Stealing.cs b/Projects/UOContent/Skills/Stealing.cs index 99c92a4c9..01c530c79 100644 --- a/Projects/UOContent/Skills/Stealing.cs +++ b/Projects/UOContent/Skills/Stealing.cs @@ -45,6 +45,9 @@ public static class Stealing public static bool IsEmptyHanded(Mobile from) => from.FindItemOnLayer(Layer.OneHanded) == null && from.FindItemOnLayer(Layer.TwoHanded) == null; + private static bool IsInLockedContainer(Item item) => + item.Parent is Item parent && (parent is LockableContainer { Locked: true } || IsInLockedContainer(parent)); + public static TimeSpan OnUse(Mobile m) { if (!IsEmptyHanded(m)) @@ -249,6 +252,10 @@ public static class Stealing { _thief.SendLocalizedMessage(502710); // You can't steal that! } + else if (_thief.AccessLevel < AccessLevel.GameMaster && IsInLockedContainer(toSteal)) + { + _thief.SendLocalizedMessage(501747); // It appears to be locked. + } else { var w = toSteal.Weight + toSteal.TotalWeight;