Atomic instead of volatile to match counter
This commit is contained in:
@@ -150,7 +150,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
|
||||
ForgeManager.itemWorkOrderLookup.remove(virtualItem);
|
||||
DbManager.removeFromCache(virtualItem);
|
||||
|
||||
workOrder.slots_used = workOrder.slots_used - 1;
|
||||
workOrder.slots_used.set(workOrder.slots_used.get() - 1);
|
||||
|
||||
// Update workOrder on disk
|
||||
|
||||
@@ -421,15 +421,15 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
|
||||
// Update total_to_produce accounting for the slot being
|
||||
// removed while workOrder is not completed.
|
||||
|
||||
if (!workOrder.runCompleted)
|
||||
if (workOrder.multiple_slot_request && workOrder.slots_used > 1) {
|
||||
int itemsPerSlot = workOrder.total_to_produce / workOrder.slots_used;
|
||||
if (!workOrder.runCompleted.get())
|
||||
if (workOrder.multiple_slot_request && workOrder.slots_used.get() > 1) {
|
||||
int itemsPerSlot = workOrder.total_to_produce / workOrder.slots_used.get();
|
||||
workOrder.total_to_produce = workOrder.total_to_produce - itemsPerSlot;
|
||||
}
|
||||
|
||||
// Slot is no longer allocated to this workOrder.
|
||||
|
||||
workOrder.slots_used = workOrder.slots_used - 1;
|
||||
workOrder.slots_used.set(workOrder.slots_used.get() - 1);
|
||||
|
||||
// Update workOrder on disk
|
||||
|
||||
|
||||
Reference in New Issue
Block a user