From 530747ed7503be8bfa9efaff0282fe2c1d8617be Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 4 Feb 2024 11:35:43 -0500 Subject: [PATCH] Slot is index driven. --- src/engine/devcmd/cmds/SlotTestCmd.java | 4 ++-- src/engine/gameManager/BuildingManager.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/engine/devcmd/cmds/SlotTestCmd.java b/src/engine/devcmd/cmds/SlotTestCmd.java index 23fc695a..d8add479 100644 --- a/src/engine/devcmd/cmds/SlotTestCmd.java +++ b/src/engine/devcmd/cmds/SlotTestCmd.java @@ -53,7 +53,7 @@ public class SlotTestCmd extends AbstractDevCmd { int slot = Integer.parseInt(args[0]); Vector3fImmutable slotLocation; - BuildingLocation buildingLocation = BuildingManager._slotLocations.get(building.meshUUID).get(slot - 1); + BuildingLocation buildingLocation = BuildingManager._slotLocations.get(building.meshUUID).get(slot); slotLocation = building.getLoc().add(buildingLocation.getLocation()); slotLocation = Vector3fImmutable.rotateAroundPoint(building.getLoc(), slotLocation, building.getBounds().getQuaternion().angleY); playerCharacter.teleport(slotLocation); @@ -71,7 +71,7 @@ public class SlotTestCmd extends AbstractDevCmd { outString += "Hirelings List:"; for (AbstractCharacter hireling : building.hirelings) - outString += "\r\n" + hireling.getName() + " slot : " + building.hirelings.indexOf(hireling) + 1; + outString += "\r\n" + hireling.getName() + " slot : " + building.hirelings.indexOf(hireling); } diff --git a/src/engine/gameManager/BuildingManager.java b/src/engine/gameManager/BuildingManager.java index adfc3c53..59e6a28b 100644 --- a/src/engine/gameManager/BuildingManager.java +++ b/src/engine/gameManager/BuildingManager.java @@ -88,7 +88,7 @@ public enum BuildingManager { if (slot == -1) return buildingLocation; - buildingLocation = _slotLocations.get(building.meshUUID).get(slot - 1); // array index + buildingLocation = _slotLocations.get(building.meshUUID).get(slot); // array index if (buildingLocation == null) { Logger.error("Invalid slot for building: " + building.getObjectUUID()); @@ -105,7 +105,7 @@ public enum BuildingManager { for (AbstractCharacter hireling : building.hirelings) { - hireling.setLoc(getSlotLocation(building, building.hirelings.indexOf(hireling) + 1).getLocation()); + hireling.setLoc(getSlotLocation(building, building.hirelings.indexOf(hireling)).getLocation()); InterestManager.setObjectDirty(hireling); }