Browse Source

Slot is index driven.

bugfix-slot-update-2
MagicBot 11 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 {
int slot = Integer.parseInt(args[0]); int slot = Integer.parseInt(args[0]);
Vector3fImmutable slotLocation; 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 = building.getLoc().add(buildingLocation.getLocation());
slotLocation = Vector3fImmutable.rotateAroundPoint(building.getLoc(), slotLocation, building.getBounds().getQuaternion().angleY); slotLocation = Vector3fImmutable.rotateAroundPoint(building.getLoc(), slotLocation, building.getBounds().getQuaternion().angleY);
playerCharacter.teleport(slotLocation); playerCharacter.teleport(slotLocation);
@ -71,7 +71,7 @@ public class SlotTestCmd extends AbstractDevCmd {
outString += "Hirelings List:"; outString += "Hirelings List:";
for (AbstractCharacter hireling : building.hirelings) 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 {
if (slot == -1) if (slot == -1)
return buildingLocation; return buildingLocation;
buildingLocation = _slotLocations.get(building.meshUUID).get(slot - 1); // array index buildingLocation = _slotLocations.get(building.meshUUID).get(slot); // array index
if (buildingLocation == null) { if (buildingLocation == null) {
Logger.error("Invalid slot for building: " + building.getObjectUUID()); Logger.error("Invalid slot for building: " + building.getObjectUUID());
@ -105,7 +105,7 @@ public enum BuildingManager {
for (AbstractCharacter hireling : building.hirelings) { 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); InterestManager.setObjectDirty(hireling);
} }

Loading…
Cancel
Save