forked from MagicBane/Server
Fix Tree of Life rank 8 hireling repositioning
This commit is contained in:
@@ -289,6 +289,34 @@ public enum BuildingManager {
|
||||
|
||||
// Method transfers ownership of all hirelings in a building
|
||||
|
||||
public static void reslotHirelings(Building building) {
|
||||
|
||||
if (building == null)
|
||||
return;
|
||||
|
||||
ArrayList<AbstractCharacter> hirelings =
|
||||
new ArrayList<>(building.getHirelings().keySet());
|
||||
|
||||
building.getHirelings().clear();
|
||||
|
||||
for (AbstractCharacter hireling : hirelings) {
|
||||
|
||||
int newSlot = NPCManager.slotCharacterInBuilding(hireling);
|
||||
|
||||
if (newSlot == -1) {
|
||||
Logger.error("Unable to re-slot hireling "
|
||||
+ hireling.getObjectUUID()
|
||||
+ " for building "
|
||||
+ building.getObjectUUID());
|
||||
continue;
|
||||
}
|
||||
|
||||
hireling.setLoc(hireling.getBindLoc());
|
||||
WorldGrid.updateObject(hireling);
|
||||
InterestManager.setObjectDirty(hireling);
|
||||
}
|
||||
}
|
||||
|
||||
public static void refreshHirelings(Building building) {
|
||||
|
||||
if (building == null)
|
||||
|
||||
@@ -427,6 +427,10 @@ public class Building extends AbstractWorldObject {
|
||||
|
||||
BuildingManager.cleanupHirelings(this);
|
||||
|
||||
if (this.getBlueprint().getBuildingGroup() == BuildingGroup.TOL
|
||||
&& this.rank == 8)
|
||||
BuildingManager.reslotHirelings(this);
|
||||
|
||||
this.isDeranking.compareAndSet(true, false);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user