Browse Source

Slot is index driven.

bugfix-slot-update-2
MagicBot 9 months ago
parent
commit
530747ed75
  1. 4
      src/engine/devcmd/cmds/SlotTestCmd.java
  2. 4
      src/engine/gameManager/BuildingManager.java

4
src/engine/devcmd/cmds/SlotTestCmd.java

@ -53,7 +53,7 @@ public class SlotTestCmd extends AbstractDevCmd { @@ -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 { @@ -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);
}

4
src/engine/gameManager/BuildingManager.java

@ -88,7 +88,7 @@ public enum BuildingManager { @@ -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 { @@ -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);
}

Loading…
Cancel
Save