From 4462f74f8ce333494b2757a90938f02de5333da6 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 7 Apr 2024 22:31:58 -0400 Subject: [PATCH] More workorder work. --- src/engine/gameManager/ForgeManager.java | 8 ++++++-- src/engine/loot/WorkOrder.java | 2 +- .../net/client/handlers/ItemProductionMsgHandler.java | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index f6632c2e..3ab9d1a1 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -42,11 +42,11 @@ public enum ForgeManager implements Runnable { // if Prefix and suffix are null random roll item // otherwise roll what was asked for - workOrder.itemCount = workOrder.itemCount - 1; + workOrder.total_to_produce = workOrder.total_to_produce - 1; Logger.info("Workorder popped: " + workOrder.workOrderID); } - if (workOrder.itemCount == 0) { + if (workOrder.total_to_produce == 0) { workOrder.runCompleted = true; @@ -68,6 +68,10 @@ public enum ForgeManager implements Runnable { public static void submit(WorkOrder workOrder) { workOrder.workOrderID = wordOrderCounter.incrementAndGet(); workOrder.completionTime = System.currentTimeMillis() + 10000; + + // 0 signifies single item roll. > 0 signifies multiple item roll. + workOrder.total_to_produce = Math.max(1, workOrder.total_to_produce); + workOrders.add(workOrder); } diff --git a/src/engine/loot/WorkOrder.java b/src/engine/loot/WorkOrder.java index b8943b86..3ba418ad 100644 --- a/src/engine/loot/WorkOrder.java +++ b/src/engine/loot/WorkOrder.java @@ -21,7 +21,7 @@ public class WorkOrder implements Delayed { public int workOrderID; public NPC vendor; public int slotCount; - public int itemCount; + public int total_to_produce; public int templateID; public String itemName; public int prefixToken; diff --git a/src/engine/net/client/handlers/ItemProductionMsgHandler.java b/src/engine/net/client/handlers/ItemProductionMsgHandler.java index 6dc2750b..4b7186ab 100644 --- a/src/engine/net/client/handlers/ItemProductionMsgHandler.java +++ b/src/engine/net/client/handlers/ItemProductionMsgHandler.java @@ -80,7 +80,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { // Create new work order WorkOrder workOrder = new WorkOrder(); - workOrder.itemCount = msg.total_to_produce; + workOrder.total_to_produce = msg.total_to_produce; workOrder.vendor = vendorNPC; workOrder.templateID = msg.templateID; workOrder.prefixToken = msg.pToken;