Browse Source

More workorder loading work

combat-2
MagicBot 7 months ago
parent
commit
286a76b1de
  1. 14
      src/engine/db/handlers/dbWarehouseHandler.java
  2. 4
      src/engine/loot/WorkOrder.java

14
src/engine/db/handlers/dbWarehouseHandler.java

@ -202,23 +202,17 @@ public class dbWarehouseHandler extends dbHandlerBase {
Logger.error(e); Logger.error(e);
} }
// Process workOrder records // Remove the old workOrder records
for (WorkOrder workOrder : submitList) for (WorkOrder workOrder : submitList)
DbManager.WarehouseQueries.DELETE_WORKORDER(workOrder); DbManager.WarehouseQueries.DELETE_WORKORDER(workOrder);
for (WorkOrder workOrder : submitList) { // Submit the new workOrders to the ForgeManager
// WorkOrder needs a new ID
for (WorkOrder workOrder : submitList) {
workOrder.workOrderID = ForgeManager.wordOrderCounter.incrementAndGet(); workOrder.workOrderID = ForgeManager.wordOrderCounter.incrementAndGet();
ForgeManager.vendorWorkOrderLookup.get(workOrder.vendor).add(workOrder);
// Reconstruct cooking items
} }
// Pass the new workOrders to the ForgeManager
} }
} }

4
src/engine/loot/WorkOrder.java

@ -8,6 +8,7 @@
package engine.loot; package engine.loot;
import engine.gameManager.ForgeManager;
import engine.mbEnums; import engine.mbEnums;
import engine.objects.Item; import engine.objects.Item;
import engine.objects.NPC; import engine.objects.NPC;
@ -88,6 +89,9 @@ public class WorkOrder implements Delayed {
for (Object o : tokenList) { for (Object o : tokenList) {
int prefix = tokenList.getInt(0); int prefix = tokenList.getInt(0);
int suffix = tokenList.getInt(1); int suffix = tokenList.getInt(1);
Item cookingItem = ForgeManager.forgeItem(this);
cookingItem.prefixToken = prefix;
cookingItem.suffixToken = suffix;
} }
} }

Loading…
Cancel
Save