diff --git a/src/engine/gameManager/BuildingManager.java b/src/engine/gameManager/BuildingManager.java index ee1750a0..1f2141e8 100644 --- a/src/engine/gameManager/BuildingManager.java +++ b/src/engine/gameManager/BuildingManager.java @@ -38,6 +38,14 @@ public enum BuildingManager { public static int getAvailableSlot(Building building) { + ArrayList slotLocations = _slotLocations.get(building.meshUUID); + + // Some meshes might not have slot locations assigned. + + if (slotLocations == null || + slotLocations.isEmpty()) + return -1; + int numOfSlots = _slotLocations.get(building.meshUUID).size(); for (int i = 1; i <= numOfSlots; i++) {