From bd370097ab73546029c2717b381663e90e9c8158 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 4 Feb 2024 12:32:10 -0500 Subject: [PATCH] Update to list based lookup --- src/engine/gameManager/BuildingManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/gameManager/BuildingManager.java b/src/engine/gameManager/BuildingManager.java index 98e185e0..82ae9ee3 100644 --- a/src/engine/gameManager/BuildingManager.java +++ b/src/engine/gameManager/BuildingManager.java @@ -55,7 +55,7 @@ public enum BuildingManager { for (int i = 0; i < numOfSlots; i++) { - if (building.hirelings.get(i) != null) + if (building.hirelings.get(i) == null) return i; } return -1; @@ -75,7 +75,7 @@ public enum BuildingManager { for (int i = numOfSlots - 1; i >= 0; i--) { - if (!building.hirelings.contains(i)) + if (building.hirelings.get(i) == null) return i; } return -1;