Browse Source

Junk or completion removes slot from workOrder

combat-2
MagicBot 8 months ago
parent
commit
27d140f703
  1. 5
      src/engine/gameManager/ForgeManager.java
  2. 4
      src/engine/net/client/handlers/ItemProductionMsgHandler.java

5
src/engine/gameManager/ForgeManager.java

@ -46,11 +46,6 @@ public enum ForgeManager implements Runnable {
Logger.error(e); Logger.error(e);
} }
// Do not process null workOrders
if (workOrder == null)
continue;
if (workOrder.total_produced >= workOrder.total_to_produce) { if (workOrder.total_produced >= workOrder.total_to_produce) {
// Complete this workOrder. // Complete this workOrder.

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

@ -146,6 +146,8 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
ForgeManager.itemWorkOrderLookup.remove(virtualItem); ForgeManager.itemWorkOrderLookup.remove(virtualItem);
DbManager.removeFromCache(virtualItem); DbManager.removeFromCache(virtualItem);
workOrder.slots_used = workOrder.slots_used - 1;
// If this is the last item then remove the workOrder from the game // If this is the last item then remove the workOrder from the game
if (workOrder.cooking.isEmpty()) if (workOrder.cooking.isEmpty())
@ -395,6 +397,8 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
DbManager.removeFromCache(virtualItem); DbManager.removeFromCache(virtualItem);
ForgeManager.itemWorkOrderLookup.remove(virtualItem); ForgeManager.itemWorkOrderLookup.remove(virtualItem);
workOrder.slots_used = workOrder.slots_used - 1;
// If this is the last item then remove the workOrder from the game // If this is the last item then remove the workOrder from the game
if (workOrder.cooking.isEmpty()) if (workOrder.cooking.isEmpty())

Loading…
Cancel
Save