diff --git a/src/engine/net/client/handlers/ItemProductionMsgHandler.java b/src/engine/net/client/handlers/ItemProductionMsgHandler.java index 734dbd6f..e475e8e1 100644 --- a/src/engine/net/client/handlers/ItemProductionMsgHandler.java +++ b/src/engine/net/client/handlers/ItemProductionMsgHandler.java @@ -107,7 +107,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); break; case COMPLETE: - completeItem(msg.itemUUID, vendor, origin); + completeItem(msg.itemUUID, vendor); break; case DEPOSIT: depositItem(msg.itemUUID, vendor, origin); @@ -124,7 +124,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { return true; } - private static void completeItem(int itemUUID, NPC vendor, ClientConnection origin) { + private static void completeItem(int itemUUID, NPC vendor) { Item virtualItem = ForgeManager.inMemoryItemLookup.get(itemUUID); @@ -143,8 +143,13 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { vendor.charItemManager.addItemToInventory(virtualItem); + // Remove from collections + WorkOrder workOrder = ForgeManager.itemWorkOrderLookup.get(virtualItem); + workOrder.cooking.remove(virtualItem); + ForgeManager.vendorItemLookup.get(vendor).remove(virtualItem); ForgeManager.itemWorkOrderLookup.remove(virtualItem); + } private static void setItemPrice(int itemType, int itemUUID, int itemPrice, NPC vendor, ClientConnection origin) {