From d7ba42f4da12d2f577f1dcc631dd5d5729f45af3 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 17 Apr 2024 13:48:39 -0400 Subject: [PATCH] Update to batch completion --- src/engine/gameManager/ForgeManager.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index d7c455fc..c5180464 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -307,10 +307,7 @@ public enum ForgeManager implements Runnable { for (Item workOrderItem : workOrder.cooking) { - // Remove the virtual items from the forge window - - ItemProductionMsg outMsg = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, workOrderItem, mbEnums.ProductionActionType.CONFIRM_SETPRICE, true); - DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg, mbEnums.DispatchChannel.SECONDARY, 700, false, false); + // Persist item Item completedItem = DbManager.ItemQueries.PERSIST(workOrderItem); @@ -331,6 +328,12 @@ public enum ForgeManager implements Runnable { // persisted when bought/taken from vendor. for (Item memoryItem : toRemove) { + + // Remove the virtual items from the forge window + + ItemProductionMsg outMsg = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, memoryItem, mbEnums.ProductionActionType.CONFIRM_SETPRICE, true); + DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg, mbEnums.DispatchChannel.SECONDARY, 700, false, false); + workOrder.cooking.remove(memoryItem); vendorItemLookup.get(workOrder.vendor).remove(memoryItem); itemWorkOrderLookup.remove(memoryItem);