From beb9d5927e553dab3cf5b5d6d849765893a9c48a Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 29 Apr 2023 08:10:59 -0400 Subject: [PATCH] Iteration bugfix. --- src/engine/gameManager/BuildingManager.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/engine/gameManager/BuildingManager.java b/src/engine/gameManager/BuildingManager.java index a13a0cf2..0d9eb143 100644 --- a/src/engine/gameManager/BuildingManager.java +++ b/src/engine/gameManager/BuildingManager.java @@ -27,7 +27,6 @@ import java.time.LocalDateTime; import java.time.ZoneId; import java.util.ArrayList; import java.util.HashMap; -import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ThreadLocalRandom; public enum BuildingManager { @@ -41,9 +40,9 @@ public enum BuildingManager { int numOfSlots = _slotLocations.get(building.meshUUID).size(); - for (int i = 1; i < numOfSlots; i++) { + for (int i = 1; i <= numOfSlots; i++) { if (!building.getHirelings().containsValue(i)) - return i; + return i; } return -1; }