Single runs are set to complete. Multiple item runs are dumped to inventory.
This commit is contained in:
@@ -64,11 +64,18 @@ public enum ForgeManager implements Runnable {
|
||||
|
||||
// Complete this workOrder.
|
||||
|
||||
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);
|
||||
if (workOrder.multiple_slot_request == false) {
|
||||
|
||||
// Single4 item runs are just set to complete
|
||||
|
||||
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);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
persistItems(workOrder);
|
||||
Logger.info("workOrder has completed: " + workOrder.workOrderID);
|
||||
ForgeManager.vendorWorkOrderLookup.get(workOrder.vendor).remove(workOrder);
|
||||
workOrder.runCompleted = true;
|
||||
@@ -192,7 +199,7 @@ public enum ForgeManager implements Runnable {
|
||||
|
||||
// Single item rolls are msg_size of 0;
|
||||
|
||||
if (availableSlots > 0 && workOrder.multiple_slot_request == 0)
|
||||
if (availableSlots > 0 && workOrder.multiple_slot_request == false)
|
||||
availableSlots = 1;
|
||||
|
||||
return availableSlots;
|
||||
|
||||
@@ -28,7 +28,7 @@ public class WorkOrder implements Delayed {
|
||||
public int slots_used;
|
||||
public int total_to_produce;
|
||||
public int total_produced;
|
||||
public int multiple_slot_request;
|
||||
public boolean multiple_slot_request;
|
||||
public HashMap<mbEnums.ResourceType, Integer> production_cost = new HashMap<>();
|
||||
public HashMap<mbEnums.ResourceType, Integer> production_cost_total = new HashMap<>();
|
||||
public int templateID;
|
||||
|
||||
@@ -82,7 +82,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
|
||||
workOrder.prefixToken = msg.pToken;
|
||||
workOrder.suffixToken = msg.sToken;
|
||||
workOrder.item_name_override = msg.name;
|
||||
workOrder.multiple_slot_request = msg.size;
|
||||
workOrder.multiple_slot_request = (msg.size != 0);
|
||||
|
||||
// Submit workOder to begin rolling items
|
||||
|
||||
|
||||
Reference in New Issue
Block a user