diff --git a/src/engine/gameManager/BuildingManager.java b/src/engine/gameManager/BuildingManager.java index c00d6b58..67d30f2b 100644 --- a/src/engine/gameManager/BuildingManager.java +++ b/src/engine/gameManager/BuildingManager.java @@ -97,6 +97,20 @@ public enum BuildingManager { return buildingLocation; } + public static void refreshHirelingSlots(Building building) { + + // Method updates all hirelings with the slot locations + // for the current mesh. The position and region can change + // such as when upgrading a TOL to R8. + + for (AbstractCharacter hireling : building.hirelings.keySet()) { + + hireling.setLoc(getSlotLocation(building, building.hirelings.get(hireling)).getLocation()); + InterestManager.setObjectDirty(hireling); + } + + } + public static boolean playerCanManage(PlayerCharacter player, Building building) { if (player == null) diff --git a/src/engine/objects/Building.java b/src/engine/objects/Building.java index 6f322a23..7ee5fb23 100644 --- a/src/engine/objects/Building.java +++ b/src/engine/objects/Building.java @@ -51,7 +51,7 @@ public class Building extends AbstractWorldObject { // Used for thread safety private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); - public final ConcurrentHashMap hirelings = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW); + public ConcurrentHashMap hirelings = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW); private final HashMap doorJobs = new HashMap<>(); public int meshUUID; public Zone parentZone;