diff --git a/src/engine/objects/Warehouse.java b/src/engine/objects/Warehouse.java index 2b0576ad..bbb1900f 100644 --- a/src/engine/objects/Warehouse.java +++ b/src/engine/objects/Warehouse.java @@ -642,10 +642,14 @@ public class Warehouse { public static HashMap calcOverflow(Warehouse warehouse, HashMap cost_map) { + // Method returns a map of resourceType that a transaction overdrafts. + HashMap overflowMap = new HashMap<>(); for (mbEnums.ResourceType resourceType : cost_map.keySet()) { + int debit = warehouse.resources.get(resourceType) - cost_map.get(resourceType); + if (debit < 0) overflowMap.put(resourceType, debit); }