Browse Source

Single runs are set to complete. Multiple item runs are dumped to inventory.

combat-2
MagicBot 8 months ago
parent
commit
d42bc3520d
  1. 15
      src/engine/gameManager/ForgeManager.java
  2. 2
      src/engine/loot/WorkOrder.java
  3. 2
      src/engine/net/client/handlers/ItemProductionMsgHandler.java

15
src/engine/gameManager/ForgeManager.java

@ -64,11 +64,18 @@ public enum ForgeManager implements Runnable { @@ -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 { @@ -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;

2
src/engine/loot/WorkOrder.java

@ -28,7 +28,7 @@ public class WorkOrder implements Delayed { @@ -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;

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

@ -82,7 +82,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { @@ -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

Loading…
Cancel
Save