From d42bc3520d1168b3d320e1412ba33b232873d85f Mon Sep 17 00:00:00 2001 From: MagicBot Date: Tue, 16 Apr 2024 15:03:59 -0400 Subject: [PATCH] Single runs are set to complete. Multiple item runs are dumped to inventory. --- src/engine/gameManager/ForgeManager.java | 15 +++++++++++---- src/engine/loot/WorkOrder.java | 2 +- .../client/handlers/ItemProductionMsgHandler.java | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index 16c24e70..a424cf26 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -64,11 +64,18 @@ public enum ForgeManager implements Runnable { // Complete this workOrder. - for (Item workOrderItem : workOrder.cooking) { - ItemProductionMsg outMsg = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, workOrderItem, mbEnums.ProductionActionType.CONFIRM_PRODUCE, true); - DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg, mbEnums.DispatchChannel.SECONDARY, 700, false, false); + if (workOrder.multiple_slot_request == false) { + + // Single4 item runs are just set to complete + + for (Item workOrderItem : workOrder.cooking) { + ItemProductionMsg outMsg = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, workOrderItem, mbEnums.ProductionActionType.CONFIRM_PRODUCE, true); + DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg, mbEnums.DispatchChannel.SECONDARY, 700, false, false); + } + continue; } + persistItems(workOrder); Logger.info("workOrder has completed: " + workOrder.workOrderID); ForgeManager.vendorWorkOrderLookup.get(workOrder.vendor).remove(workOrder); workOrder.runCompleted = true; @@ -192,7 +199,7 @@ public enum ForgeManager implements Runnable { // Single item rolls are msg_size of 0; - if (availableSlots > 0 && workOrder.multiple_slot_request == 0) + if (availableSlots > 0 && workOrder.multiple_slot_request == false) availableSlots = 1; return availableSlots; diff --git a/src/engine/loot/WorkOrder.java b/src/engine/loot/WorkOrder.java index 5bfc1f84..17a0eb4c 100644 --- a/src/engine/loot/WorkOrder.java +++ b/src/engine/loot/WorkOrder.java @@ -28,7 +28,7 @@ public class WorkOrder implements Delayed { public int slots_used; public int total_to_produce; public int total_produced; - public int multiple_slot_request; + public boolean multiple_slot_request; public HashMap production_cost = new HashMap<>(); public HashMap production_cost_total = new HashMap<>(); public int templateID; diff --git a/src/engine/net/client/handlers/ItemProductionMsgHandler.java b/src/engine/net/client/handlers/ItemProductionMsgHandler.java index c77283b6..bac40739 100644 --- a/src/engine/net/client/handlers/ItemProductionMsgHandler.java +++ b/src/engine/net/client/handlers/ItemProductionMsgHandler.java @@ -82,7 +82,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { workOrder.prefixToken = msg.pToken; workOrder.suffixToken = msg.sToken; workOrder.item_name_override = msg.name; - workOrder.multiple_slot_request = msg.size; + workOrder.multiple_slot_request = (msg.size != 0); // Submit workOder to begin rolling items