From 8bf782615046369bea2496fb343f8e3f11222baa Mon Sep 17 00:00:00 2001 From: cydyn <144380768+cydyn@users.noreply.github.com> Date: Mon, 5 Feb 2024 07:55:15 +0100 Subject: [PATCH] Aru update --- Intersect.Server.Core/Entities/BankInterface.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Intersect.Server.Core/Entities/BankInterface.cs b/Intersect.Server.Core/Entities/BankInterface.cs index c4fa153063..a01ad79de2 100644 --- a/Intersect.Server.Core/Entities/BankInterface.cs +++ b/Intersect.Server.Core/Entities/BankInterface.cs @@ -236,6 +236,13 @@ out var slotIndicesToRemoveFrom Debug.Assert(slotToRemoveFrom != default); var quantityToRemoveFromSlot = Math.Min(remainingQuantityToRemove, slotToRemoveFrom.Quantity); slotToRemoveFrom.Quantity -= quantityToRemoveFromSlot; + + // If the item is equipped equipment, we need to unequip it before taking it out of the inventory. + if (itemDescriptor.ItemType == ItemType.Equipment && slotIndexToRemoveFrom > -1) + { + mPlayer.EquipmentProcessItemLoss(slotIndexToRemoveFrom); + } + if (slotToRemoveFrom.Quantity < 1) { slotToRemoveFrom.Set(Item.None); @@ -264,14 +271,6 @@ out var slotIndicesToRemoveFrom Log.Error($"{mPlayer.Id} did not have {remainingQuantity}x {itemDescriptor.Id} taken"); } - if (itemDescriptor.ItemType == ItemType.Equipment) - { - if (inventorySlotIndex > -1) - { - mPlayer.EquipmentProcessItemLoss(inventorySlotIndex); - } - } - if (sendUpdate) { foreach (var slotIndexToUpdate in slotIndicesToRemoveFrom)