Browse Source

Window refresh update

combat-2
MagicBot 7 months ago
parent
commit
0f2b46b898
  1. 24
      src/engine/gameManager/ForgeManager.java

24
src/engine/gameManager/ForgeManager.java

@ -323,10 +323,13 @@ public enum ForgeManager implements Runnable {
public static void completeWorkOrderBatch(WorkOrder workOrder) { public static void completeWorkOrderBatch(WorkOrder workOrder) {
ArrayList<Item> toRemove = new ArrayList<>();
for (Item workOrderItem : workOrder.cooking) { for (Item workOrderItem : workOrder.cooking) {
// Remove the virtual items from the forge window
workOrder.cooking.remove(workOrderItem);
itemWorkOrderLookup.remove(workOrderItem);
// Persist item // Persist item
Item completedItem = DbManager.ItemQueries.PERSIST(workOrderItem); Item completedItem = DbManager.ItemQueries.PERSIST(workOrderItem);
@ -339,23 +342,6 @@ public enum ForgeManager implements Runnable {
DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg1, mbEnums.DispatchChannel.SECONDARY, 700, false, false); DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg1, mbEnums.DispatchChannel.SECONDARY, 700, false, false);
ItemProductionMsg outMsg2 = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, completedItem, mbEnums.ProductionActionType.CONFIRM_DEPOSIT, true); ItemProductionMsg outMsg2 = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, completedItem, mbEnums.ProductionActionType.CONFIRM_DEPOSIT, true);
DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg2, mbEnums.DispatchChannel.SECONDARY, 700, false, false); DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg2, mbEnums.DispatchChannel.SECONDARY, 700, false, false);
toRemove.add(workOrderItem);
}
// Remove the negativeID virtual item from all collections
// other than the virtual item lookup map. Item will be
// persisted when bought/taken from vendor.
for (Item memoryItem : toRemove) {
// Remove the virtual items from the forge window
ItemProductionMsg outMsg = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, memoryItem, mbEnums.ProductionActionType.CONFIRM_SETPRICE, true);
DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg, mbEnums.DispatchChannel.SECONDARY, 700, false, false);
workOrder.cooking.remove(memoryItem);
itemWorkOrderLookup.remove(memoryItem);
} }
} }

Loading…
Cancel
Save