Refresh method created.

This commit is contained in:
2024-02-04 08:18:46 -05:00
parent acc253aa4d
commit 3cf6bba0f4
2 changed files with 15 additions and 1 deletions
@@ -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)
+1 -1
View File
@@ -51,7 +51,7 @@ public class Building extends AbstractWorldObject {
// Used for thread safety
private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
public final ConcurrentHashMap<AbstractCharacter, Integer> hirelings = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
public ConcurrentHashMap<AbstractCharacter, Integer> hirelings = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
private final HashMap<Integer, DoorCloseJob> doorJobs = new HashMap<>();
public int meshUUID;
public Zone parentZone;