From 8b4b3b971a7bbce97feb0ac626cbe7df4e77285c Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 14 Apr 2024 16:46:31 -0400 Subject: [PATCH] forged items are persisted --- src/engine/gameManager/ForgeManager.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index 3f73fe54..0fbb5ae3 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -61,11 +61,12 @@ public enum ForgeManager implements Runnable { // workOrder ArrayList toRemove = new ArrayList<>(); + Item completed_item = null; for (Item cooked_item : workOrder.cooking) { toRemove.add(cooked_item); cooked_item.containerType = mbEnums.ItemContainerType.INVENTORY; - Item completed_item = DbManager.ItemQueries.PERSIST(cooked_item); + completed_item = DbManager.ItemQueries.PERSIST(cooked_item); workOrder.vendor.charItemManager.addItemToInventory(completed_item); } @@ -78,8 +79,12 @@ public enum ForgeManager implements Runnable { vendorItemLookup.get(workOrder.vendor).remove(memoryItem); } - Logger.info("item forged:" + workOrder.workOrderID + " (" + workOrder.total_produced + "/" + workOrder.total_to_produce + ")"); + // Update vendor window + + ItemProductionMsg outMsg = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, completed_item, 8, true); + DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg, mbEnums.DispatchChannel.SECONDARY, 700, false, false); + Logger.info("item forged:" + workOrder.workOrderID + " (" + workOrder.total_produced + "/" + workOrder.total_to_produce + ")"); if (workOrder.total_produced >= workOrder.total_to_produce) { Logger.info("workOrder has completed: " + workOrder.workOrderID);