Browse Source

More workorder db work

combat-2
MagicBot 8 months ago
parent
commit
c03f464043
  1. 14
      src/engine/net/client/handlers/ItemProductionMsgHandler.java

14
src/engine/net/client/handlers/ItemProductionMsgHandler.java

@ -148,10 +148,13 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
workOrder.slots_used = workOrder.slots_used - 1; 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); ForgeManager.vendorWorkOrderLookup.get(vendor).remove(workOrder);
DbManager.WarehouseQueries.DELETE_WORKORDER(workOrder);
} else
DbManager.WarehouseQueries.UPDATE_WORKORDER(workOrder);
// Persist item and add to vendor inventory // Persist item and add to vendor inventory
@ -399,10 +402,13 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
workOrder.slots_used = workOrder.slots_used - 1; 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); ForgeManager.vendorWorkOrderLookup.get(vendor).remove(workOrder);
DbManager.WarehouseQueries.DELETE_WORKORDER(workOrder);
} else
DbManager.WarehouseQueries.UPDATE_WORKORDER(workOrder);
// Refresh vendor's inventory to client // Refresh vendor's inventory to client

Loading…
Cancel
Save