diff --git a/Content.Shared/Inventory/InventorySystem.Equip.cs b/Content.Shared/Inventory/InventorySystem.Equip.cs index f3181a87b1..90c9f0e1e0 100644 --- a/Content.Shared/Inventory/InventorySystem.Equip.cs +++ b/Content.Shared/Inventory/InventorySystem.Equip.cs @@ -27,6 +27,7 @@ public abstract partial class InventorySystem [Dependency] private readonly SharedHandsSystem _handsSystem = default!; [Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly INetManager _netMan = default!; + [Dependency] private readonly SharedTransformSystem _transform = default!; private void InitializeEquip() { @@ -372,20 +373,10 @@ public abstract partial class InventorySystem } } - if (force) - { - slotContainer.ForceRemove(removedItem.Value); - } - else - { - if (!slotContainer.Remove(removedItem.Value)) - { - //should never happen bc of the canremove lets just keep in just in case - return false; - } - } + if (!slotContainer.Remove(removedItem.Value, force: force)) + return false; - Transform(removedItem.Value).Coordinates = Transform(target).Coordinates; + _transform.DropNextTo(removedItem.Value, target); if (!silent && Resolve(removedItem.Value, ref clothing, false) && clothing.UnequipSound != null && _gameTiming.IsFirstTimePredicted) { @@ -405,8 +396,7 @@ public abstract partial class InventorySystem SoundSystem.Play(clothing.UnequipSound.GetSound(), filter, target, clothing.UnequipSound.Params.WithVolume(-2f)); } - inventory.Dirty(); - + Dirty(target, inventory); _movementSpeed.RefreshMovementSpeedModifiers(target); return true;