More workorder db work
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user