More workorder work.

This commit is contained in:
2024-04-07 22:31:58 -04:00
parent 781053ab22
commit 4462f74f8c
3 changed files with 8 additions and 4 deletions
+6 -2
View File
@@ -42,11 +42,11 @@ public enum ForgeManager implements Runnable {
// if Prefix and suffix are null random roll item
// otherwise roll what was asked for
workOrder.itemCount = workOrder.itemCount - 1;
workOrder.total_to_produce = workOrder.total_to_produce - 1;
Logger.info("Workorder popped: " + workOrder.workOrderID);
}
if (workOrder.itemCount == 0) {
if (workOrder.total_to_produce == 0) {
workOrder.runCompleted = true;
@@ -68,6 +68,10 @@ public enum ForgeManager implements Runnable {
public static void submit(WorkOrder workOrder) {
workOrder.workOrderID = wordOrderCounter.incrementAndGet();
workOrder.completionTime = System.currentTimeMillis() + 10000;
// 0 signifies single item roll. > 0 signifies multiple item roll.
workOrder.total_to_produce = Math.max(1, workOrder.total_to_produce);
workOrders.add(workOrder);
}