From 178bb3718a6d74fe0facf1f9a6c30099faf3a5d4 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 8 Apr 2024 13:10:23 -0400 Subject: [PATCH] Slot count calculated --- src/engine/gameManager/ForgeManager.java | 4 ++-- src/engine/net/client/handlers/ItemProductionMsgHandler.java | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index 814bba45..c0193c68 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -119,9 +119,9 @@ public enum ForgeManager implements Runnable { int availableSlots = workOrder.vendor.getRank(); - for (WorkOrder npcWorkOrder : workOrder.vendor.workOrders) { + for (WorkOrder npcWorkOrder : workOrder.vendor.workOrders) + availableSlots = availableSlots - npcWorkOrder.slotCount; - } return availableSlots; } } diff --git a/src/engine/net/client/handlers/ItemProductionMsgHandler.java b/src/engine/net/client/handlers/ItemProductionMsgHandler.java index 2da4d985..c8a62ece 100644 --- a/src/engine/net/client/handlers/ItemProductionMsgHandler.java +++ b/src/engine/net/client/handlers/ItemProductionMsgHandler.java @@ -87,6 +87,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { workOrder.suffixToken = msg.sToken; workOrder.itemName = msg.name; workOrder.rollingDuration = ForgeManager.calcRollingDuration(workOrder); + workOrder.slotCount = ForgeManager.getAvailableSlots(workOrder); // Validate vendor can roll this item