From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Wed, 3 Jan 2024 06:16:37 +0000 (-0500) Subject: Fix small logic issue in item slot swapping (#23378) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=58d518a2a0c1a74d92a5a5f8dfc1c8c62d209f4a;p=space-station-14.git Fix small logic issue in item slot swapping (#23378) fix swapping item slots sometimes failing --- 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);