Skip to content

Commit

Permalink
Aru update
Browse files Browse the repository at this point in the history
  • Loading branch information
cydyn committed Feb 5, 2024
1 parent e917f8e commit 8bf7826
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions Intersect.Server.Core/Entities/BankInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 8bf7826

Please sign in to comment.