From 58d518a2a0c1a74d92a5a5f8dfc1c8c62d209f4a Mon Sep 17 00:00:00 2001 From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Wed, 3 Jan 2024 01:16:37 -0500 Subject: [PATCH] Fix small logic issue in item slot swapping (#23378) fix swapping item slots sometimes failing --- Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs b/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs index bc2225a94c..d832cdfef8 100644 --- a/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs +++ b/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs @@ -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); -- 2.51.2