Browse Source

Expand scope of try block.

combat-2
MagicBot 7 months ago
parent
commit
e1d43ce0d0
  1. 51
      src/engine/gameManager/ForgeManager.java

51
src/engine/gameManager/ForgeManager.java

@ -42,46 +42,47 @@ public enum ForgeManager implements Runnable { @@ -42,46 +42,47 @@ public enum ForgeManager implements Runnable {
try {
workOrder = forge.take();
} catch (Exception e) {
Logger.error(e);
}
if (workOrder.total_produced >= workOrder.total_to_produce) {
if (workOrder.total_produced >= workOrder.total_to_produce) {
// Complete this workOrder.
// Complete this workOrder.
for (Item workOrderItem : workOrder.cooking) {
workOrderItem.flags.add(mbEnums.ItemFlags.Identified);
ItemProductionMsg outMsg = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, workOrderItem, mbEnums.ProductionActionType.CONFIRM_PRODUCE, true);
DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg, mbEnums.DispatchChannel.SECONDARY, 700, false, false);
}
for (Item workOrderItem : workOrder.cooking) {
workOrderItem.flags.add(mbEnums.ItemFlags.Identified);
ItemProductionMsg outMsg = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, workOrderItem, mbEnums.ProductionActionType.CONFIRM_PRODUCE, true);
DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg, mbEnums.DispatchChannel.SECONDARY, 700, false, false);
}
workOrder.runCompleted = true;
workOrder.runCompleted = true;
// Update workorder to disk
// Update workorder to disk
DbManager.WarehouseQueries.UPDATE_WORKORDER(workOrder);
}
DbManager.WarehouseQueries.UPDATE_WORKORDER(workOrder);
}
if (workOrder.runCompleted)
continue;
if (workOrder.runCompleted)
continue;
// Move current cooking batch to vendor inventory
// Move current cooking batch to vendor inventory
completeWorkOrderBatch(workOrder);
completeWorkOrderBatch(workOrder);
// Create new set of in-memory only virtual items
// Create new set of in-memory only virtual items
forgeWorkOrderBatch(workOrder);
forgeWorkOrderBatch(workOrder);
// enQueue this workOrder again; back into the oven
// until all items for this workOrder are completed.
// enQueue this workOrder again; back into the oven
// until all items for this workOrder are completed.
forge.add(workOrder);
forge.add(workOrder);
// Debugging
// Debugging
Logger.info(workOrder.toString());
Logger.info(workOrder.toString());
} catch (Exception e) {
Logger.error(e);
}
}
}

Loading…
Cancel
Save