From 77673fde5f78a545d80d0448ef99a308b1434d76 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Fri, 10 May 2024 09:34:58 -0400 Subject: [PATCH] completed workOrders handling update --- src/engine/gameManager/ForgeManager.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index 6bad092e..143a69cb 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -62,6 +62,11 @@ public enum ForgeManager implements Runnable { try { workOrder = forge.take(); + // For workOrders loaded from disk + + if (workOrder.runCompleted) + continue; + // This workOrder has completed production. if (workOrder.total_produced >= workOrder.total_to_produce) { @@ -81,10 +86,8 @@ public enum ForgeManager implements Runnable { // Update workOrder on disk DbManager.WarehouseQueries.WRITE_WORKORDER(workOrder); - } - - if (workOrder.runCompleted) continue; + } // PERSIST current cooking batch and move // our new items to vendor inventory