]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix small logic issue in item slot swapping (#23378)
authorNemanja <98561806+EmoGarbage404@users.noreply.github.com>
Wed, 3 Jan 2024 06:16:37 +0000 (01:16 -0500)
committerGitHub <noreply@github.com>
Wed, 3 Jan 2024 06:16:37 +0000 (17:16 +1100)
fix swapping item slots sometimes failing

Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs

index bc2225a94c8844cea080bcabe8f553453e6a95ea..d832cdfef8cff27dbe6ad111f1aca459deaf7593 100644 (file)
@@ -265,6 +265,9 @@ namespace Content.Shared.Containers.ItemSlots
                 return false;
             }
 
+            if (swap && slot.HasItem && !CanEject(uid, user, slot))
+                return false;
+
             var ev = new ItemSlotInsertAttemptEvent(uid, usedUid, user, slot);
             RaiseLocalEvent(uid, ref ev);
             RaiseLocalEvent(usedUid, ref ev);