More workorder db work

This commit is contained in:
2024-04-22 15:12:46 -04:00
parent 7b7492b5cc
commit c03f464043
@@ -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