Browse Source

Persist item work

combat-2
MagicBot 8 months ago
parent
commit
9ba697c310
  1. 18
      src/engine/gameManager/ForgeManager.java

18
src/engine/gameManager/ForgeManager.java

@ -61,8 +61,7 @@ public enum ForgeManager implements Runnable {
if (workOrder.total_produced >= workOrder.total_to_produce) { if (workOrder.total_produced >= workOrder.total_to_produce) {
// Complete this workOrder. Persist items currently in memory // Complete this workOrder.
// and set the items as completed.
for (Item workOrderItem : workOrder.cooking) { for (Item workOrderItem : workOrder.cooking) {
ItemProductionMsg outMsg = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, workOrderItem, mbEnums.ProductionActionType.CONFIRM_PRODUCE, true); ItemProductionMsg outMsg = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, workOrderItem, mbEnums.ProductionActionType.CONFIRM_PRODUCE, true);
@ -71,7 +70,22 @@ public enum ForgeManager implements Runnable {
Logger.info("workOrder has completed: " + workOrder.workOrderID); Logger.info("workOrder has completed: " + workOrder.workOrderID);
workOrder.runCompleted = true; workOrder.runCompleted = true;
}
if (workOrder.runCompleted == true)
continue; continue;
;
// Persist items that were currently cooking
for (Item workOrderItem : workOrder.cooking) {
// 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);
ItemProductionMsg outMsg1 = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, workOrderItem, mbEnums.ProductionActionType.CONFIRM_SETPRICE, true);
DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg1, mbEnums.DispatchChannel.SECONDARY, 700, false, false);
ItemProductionMsg outMsg = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, workOrderItem, mbEnums.ProductionActionType.CONFIRM_DEPOSIT, true);
DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg, mbEnums.DispatchChannel.SECONDARY, 700, false, false);
} }
// Create new set in memory items // Create new set in memory items

Loading…
Cancel
Save