From b0c0c507e584ba4180f8a5364e78770df48e1a44 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 15 Apr 2024 14:59:07 -0400 Subject: [PATCH] More window work --- src/engine/gameManager/ForgeManager.java | 9 ++++----- .../net/client/handlers/ItemProductionMsgHandler.java | 7 +++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index 8a283caa..2da142aa 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -300,12 +300,11 @@ public enum ForgeManager implements Runnable { for (Item workOrderItem : workOrder.cooking) { toRemove.add(workOrderItem); - workOrderItem.containerType = mbEnums.ItemContainerType.INVENTORY; - // 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); - // ItemProductionMsg outMsg2 = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, workOrderItem, mbEnums.ProductionActionType.CONFIRM_DEPOSIT, true); - // DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg2, mbEnums.DispatchChannel.SECONDARY, 700, false, false); + 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); + ItemProductionMsg outMsg2 = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, workOrderItem, mbEnums.ProductionActionType.CONFIRM_DEPOSIT, true); + DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg2, mbEnums.DispatchChannel.SECONDARY, 700, false, false); completed_item = DbManager.ItemQueries.PERSIST(workOrderItem); diff --git a/src/engine/net/client/handlers/ItemProductionMsgHandler.java b/src/engine/net/client/handlers/ItemProductionMsgHandler.java index c9526bea..c77283b6 100644 --- a/src/engine/net/client/handlers/ItemProductionMsgHandler.java +++ b/src/engine/net/client/handlers/ItemProductionMsgHandler.java @@ -364,6 +364,13 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { workOrder.cooking.remove(targetItem); ForgeManager.vendorItemLookup.get(workOrder.vendor).remove(targetItem); + // Update workOrder to reflect canceled slot + + workOrder.slots_used = workOrder.slots_used - 1; + + if (workOrder.slots_used == 0) + workOrder.runCanceled = true; + // Refresh vendor's inventory to client outMsg = new ManageNPCMsg(vendor);