From 652476fde88e953e99224b109f29a23ed946fd1d Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 8 Apr 2024 04:37:27 -0400 Subject: [PATCH] Track items and their workorders. --- src/engine/gameManager/ForgeManager.java | 3 +++ src/engine/objects/NPC.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index d3b32326..347fe11d 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -49,6 +49,8 @@ public enum ForgeManager implements Runnable { if (workOrder.total_to_produce == 0) { workOrder.runCompleted = true; + workOrder.vendor.workOrders.remove(workOrder); + Logger.info("Workorder has completed: " + workOrder.workOrderID); // Remove this workOrder from any slots on vendor @@ -85,6 +87,7 @@ public enum ForgeManager implements Runnable { workOrder.total_to_produce = Math.max(1, workOrder.total_to_produce); + workOrder.vendor.workOrders.add(workOrder); workOrders.add(workOrder); } diff --git a/src/engine/objects/NPC.java b/src/engine/objects/NPC.java index 9e38eff3..95cafce1 100644 --- a/src/engine/objects/NPC.java +++ b/src/engine/objects/NPC.java @@ -79,7 +79,7 @@ public class NPC extends AbstractCharacter { public int parentZoneUUID; public int equipmentSetID = 0; private int repairCost = 5; - ArrayList workOrders = new ArrayList<>(); + public ArrayList workOrders = new ArrayList<>(); // New NPC constructor. Fill in the blanks and then call // PERSIST.