From 286a76b1def1bc048317ab76e6eb89e44ed6fd5f Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 22 Apr 2024 16:07:25 -0400 Subject: [PATCH] More workorder loading work --- src/engine/db/handlers/dbWarehouseHandler.java | 14 ++++---------- src/engine/loot/WorkOrder.java | 4 ++++ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/engine/db/handlers/dbWarehouseHandler.java b/src/engine/db/handlers/dbWarehouseHandler.java index f353a046..32b25399 100644 --- a/src/engine/db/handlers/dbWarehouseHandler.java +++ b/src/engine/db/handlers/dbWarehouseHandler.java @@ -202,23 +202,17 @@ public class dbWarehouseHandler extends dbHandlerBase { Logger.error(e); } - // Process workOrder records + // Remove the old workOrder records for (WorkOrder workOrder : submitList) DbManager.WarehouseQueries.DELETE_WORKORDER(workOrder); - for (WorkOrder workOrder : submitList) { - - // WorkOrder needs a new ID + // Submit the new workOrders to the ForgeManager + for (WorkOrder workOrder : submitList) { workOrder.workOrderID = ForgeManager.wordOrderCounter.incrementAndGet(); - - // Reconstruct cooking items - + ForgeManager.vendorWorkOrderLookup.get(workOrder.vendor).add(workOrder); } - // Pass the new workOrders to the ForgeManager - - } } diff --git a/src/engine/loot/WorkOrder.java b/src/engine/loot/WorkOrder.java index 59eec45f..b3a19031 100644 --- a/src/engine/loot/WorkOrder.java +++ b/src/engine/loot/WorkOrder.java @@ -8,6 +8,7 @@ package engine.loot; +import engine.gameManager.ForgeManager; import engine.mbEnums; import engine.objects.Item; import engine.objects.NPC; @@ -88,6 +89,9 @@ public class WorkOrder implements Delayed { for (Object o : tokenList) { int prefix = tokenList.getInt(0); int suffix = tokenList.getInt(1); + Item cookingItem = ForgeManager.forgeItem(this); + cookingItem.prefixToken = prefix; + cookingItem.suffixToken = suffix; } }