Compare commits

...

2 Commits

Author SHA1 Message Date
MagicBot 1b5a64d8fc Minor cleanup 2024-04-27 08:17:43 -04:00
MagicBot 01f0e25e08 Minor cleanup 2024-04-27 08:17:17 -04:00
@@ -130,6 +130,10 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
WorkOrder workOrder = ForgeManager.itemWorkOrderLookup.get(virtualItem);
City city = workOrder.vendor.building.getCity();
if (city == null)
return;
city.transactionLock.writeLock().lock();
try {
@@ -286,7 +290,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
}
// Method completes an item that has been previously rolled
// adding it to the NPC's inventory
// adding it to the Vendor inventory
private static void recycleItem(HashMap<Integer, Integer> itemList, NPC vendor, ClientConnection origin) {
@@ -398,9 +402,8 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
if (workOrder == null)
return;
if (workOrder.cooking.contains(virtualItem) == false)
if (!workOrder.cooking.contains(virtualItem))
return;
;
City city = workOrder.vendor.building.getCity();
@@ -418,11 +421,11 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
// Update total_to_produce accounting for the slot being
// removed while workOrder is not completed.
if (workOrder.runCompleted == false)
if (!workOrder.runCompleted)
if (workOrder.multiple_slot_request && workOrder.slots_used > 1) {
int itemsPerSlot = workOrder.total_to_produce / workOrder.slots_used;
workOrder.total_to_produce = workOrder.total_to_produce - itemsPerSlot;
}
int itemsPerSlot = workOrder.total_to_produce / workOrder.slots_used;
workOrder.total_to_produce = workOrder.total_to_produce - itemsPerSlot;
}
// Slot is no longer allocated to this workOrder.
@@ -476,9 +479,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
player.charItemManager.buyFromNPC(targetItem, vendor);
}
player.charItemManager.updateInventory();
}
}