diff --git a/src/engine/net/client/handlers/ItemProductionMsgHandler.java b/src/engine/net/client/handlers/ItemProductionMsgHandler.java index 05528578..61657863 100644 --- a/src/engine/net/client/handlers/ItemProductionMsgHandler.java +++ b/src/engine/net/client/handlers/ItemProductionMsgHandler.java @@ -148,10 +148,13 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { workOrder.slots_used = workOrder.slots_used - 1; - // If this is the last item then remove the workOrder from the game + // Update workOrder on disk - if (workOrder.cooking.isEmpty()) + if (workOrder.cooking.isEmpty()) { ForgeManager.vendorWorkOrderLookup.get(vendor).remove(workOrder); + DbManager.WarehouseQueries.DELETE_WORKORDER(workOrder); + } else + DbManager.WarehouseQueries.UPDATE_WORKORDER(workOrder); // Persist item and add to vendor inventory @@ -399,10 +402,13 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { workOrder.slots_used = workOrder.slots_used - 1; - // If this is the last item then remove the workOrder from the game + // Update workOrder on disk - if (workOrder.cooking.isEmpty()) + if (workOrder.cooking.isEmpty()) { ForgeManager.vendorWorkOrderLookup.get(vendor).remove(workOrder); + DbManager.WarehouseQueries.DELETE_WORKORDER(workOrder); + } else + DbManager.WarehouseQueries.UPDATE_WORKORDER(workOrder); // Refresh vendor's inventory to client