From 6878916874c6c0cab13bb51e2eb6008f9b929de4 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 11 May 2024 08:51:41 -0400 Subject: [PATCH] Update to workOrder cleanup --- src/engine/gameManager/BuildingManager.java | 1 + src/engine/gameManager/ForgeManager.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/engine/gameManager/BuildingManager.java b/src/engine/gameManager/BuildingManager.java index ea2712da..d2905bcd 100644 --- a/src/engine/gameManager/BuildingManager.java +++ b/src/engine/gameManager/BuildingManager.java @@ -336,6 +336,7 @@ public enum BuildingManager { if (ForgeManager.vendorWorkOrderLookup.get(hirelingNPC) != null) for (WorkOrder workOrder : ForgeManager.vendorWorkOrderLookup.get(hirelingNPC)) { workOrder.runCompleted = true; + workOrder.vendor = null; DbManager.WarehouseQueries.DELETE_WORKORDER(workOrder); } } diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index 143a69cb..9c2de31f 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -63,8 +63,9 @@ public enum ForgeManager implements Runnable { workOrder = forge.take(); // For workOrders loaded from disk + // or vendors who were re-deeded - if (workOrder.runCompleted) + if (workOrder.vendor == null && workOrder.runCompleted) continue; // This workOrder has completed production.