From 27d140f70393f6430ccb21e4e9c0ed463ba7b8a7 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 22 Apr 2024 08:28:43 -0400 Subject: [PATCH] Junk or completion removes slot from workOrder --- src/engine/gameManager/ForgeManager.java | 5 ----- src/engine/net/client/handlers/ItemProductionMsgHandler.java | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index b9bc3d7a..b0e3ee61 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -46,11 +46,6 @@ public enum ForgeManager implements Runnable { Logger.error(e); } - // Do not process null workOrders - - if (workOrder == null) - continue; - if (workOrder.total_produced >= workOrder.total_to_produce) { // Complete this workOrder. diff --git a/src/engine/net/client/handlers/ItemProductionMsgHandler.java b/src/engine/net/client/handlers/ItemProductionMsgHandler.java index e8810c48..05528578 100644 --- a/src/engine/net/client/handlers/ItemProductionMsgHandler.java +++ b/src/engine/net/client/handlers/ItemProductionMsgHandler.java @@ -146,6 +146,8 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { ForgeManager.itemWorkOrderLookup.remove(virtualItem); DbManager.removeFromCache(virtualItem); + workOrder.slots_used = workOrder.slots_used - 1; + // If this is the last item then remove the workOrder from the game if (workOrder.cooking.isEmpty()) @@ -395,6 +397,8 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { DbManager.removeFromCache(virtualItem); ForgeManager.itemWorkOrderLookup.remove(virtualItem); + workOrder.slots_used = workOrder.slots_used - 1; + // If this is the last item then remove the workOrder from the game if (workOrder.cooking.isEmpty())