Browse Source

Withdraw logic cleanup

combat-2
MagicBot 6 months ago
parent
commit
f465ea4045
  1. 4
      src/engine/loot/WorkOrder.java

4
src/engine/loot/WorkOrder.java

@ -165,9 +165,9 @@ public class WorkOrder implements Delayed {
if (warehouse == null) if (warehouse == null)
return false; return false;
int remainingAmount = workOrder.production_cost_total.get(mbEnums.ResourceType.GOLD) - strongbox; int overflowAmount = workOrder.production_cost_total.get(mbEnums.ResourceType.GOLD) - strongbox;
workOrder.vendor.building.setStrongboxValue(0); workOrder.vendor.building.setStrongboxValue(0);
workOrder.production_cost_total.put(mbEnums.ResourceType.GOLD, workOrder.production_cost_total.get(mbEnums.ResourceType.GOLD) - remainingAmount); workOrder.production_cost_total.put(mbEnums.ResourceType.GOLD, workOrder.production_cost_total.get(mbEnums.ResourceType.GOLD) - overflowAmount);
// Deduct total production cost from warehouse // Deduct total production cost from warehouse

Loading…
Cancel
Save