Remove from equip before changing slot.

This commit is contained in:
2024-03-09 09:09:17 -05:00
parent 3500bf0ede
commit c6f451bce1
2 changed files with 4 additions and 4 deletions
@@ -58,8 +58,10 @@ public class TransferItemFromEquipToInventoryHandler extends AbstractClientMsgHa
if (!item.validForEquip(origin, player, itemManager))
return true;
if (item.containerType == Enum.ItemContainerType.EQUIPPED)
if (item.containerType == Enum.ItemContainerType.EQUIPPED) {
itemManager.equipped.remove(item.equipSlot);
itemManager.moveItemToInventory(item);
}
int ItemType = item.getObjectType().ordinal();
int ItemID = item.getObjectUUID();
+1 -3
View File
@@ -46,7 +46,7 @@ public class CharacterItemManager {
private final ConcurrentHashMap<Integer, Integer> itemIDtoType = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
// Mapping of all items equipped in this Manager
// Key = Item Slot
private final ConcurrentHashMap<Enum.EquipSlotType, Item> equipped = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
public final ConcurrentHashMap<Enum.EquipSlotType, Item> equipped = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
private final HashSet<Item> inventory = new HashSet<>();
private final HashSet<Item> bank = new HashSet<>();
private final HashSet<Item> vault = new HashSet<>();
@@ -1691,8 +1691,6 @@ public class CharacterItemManager {
}
private synchronized void remItemFromLists(Item i) {
this.equipped.remove(i.equipSlot);
this.vault.remove(i);
this.bank.remove(i);
this.inventory.remove(i);