|
|
@ -53,9 +53,9 @@ public enum BuildingManager { |
|
|
|
|
|
|
|
|
|
|
|
int numOfSlots = _slotLocations.get(building.meshUUID).size(); |
|
|
|
int numOfSlots = _slotLocations.get(building.meshUUID).size(); |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 1; i <= numOfSlots; i++) { |
|
|
|
for (int i = 0; i < numOfSlots; i++) { |
|
|
|
|
|
|
|
|
|
|
|
if (!building.hirelings.containsValue(i)) |
|
|
|
if (!building.hirelings.contains(i)) |
|
|
|
return i; |
|
|
|
return i; |
|
|
|
} |
|
|
|
} |
|
|
|
return -1; |
|
|
|
return -1; |
|
|
@ -73,9 +73,9 @@ public enum BuildingManager { |
|
|
|
|
|
|
|
|
|
|
|
int numOfSlots = _slotLocations.get(building.meshUUID).size(); |
|
|
|
int numOfSlots = _slotLocations.get(building.meshUUID).size(); |
|
|
|
|
|
|
|
|
|
|
|
for (int i = numOfSlots; i > 0; i--) { |
|
|
|
for (int i = numOfSlots - 1; i >= 0; i--) { |
|
|
|
|
|
|
|
|
|
|
|
if (!building.hirelings.containsValue(i)) |
|
|
|
if (!building.hirelings.contains(i)) |
|
|
|
return i; |
|
|
|
return i; |
|
|
|
} |
|
|
|
} |
|
|
|
return -1; |
|
|
|
return -1; |
|
|
@ -103,9 +103,9 @@ public enum BuildingManager { |
|
|
|
// for the current mesh. The position and region can change
|
|
|
|
// for the current mesh. The position and region can change
|
|
|
|
// such as when upgrading a TOL to R8.
|
|
|
|
// such as when upgrading a TOL to R8.
|
|
|
|
|
|
|
|
|
|
|
|
for (AbstractCharacter hireling : building.hirelings.keySet()) { |
|
|
|
for (AbstractCharacter hireling : building.hirelings) { |
|
|
|
|
|
|
|
|
|
|
|
hireling.setLoc(getSlotLocation(building, building.hirelings.get(hireling)).getLocation()); |
|
|
|
hireling.setLoc(getSlotLocation(building, building.hirelings.indexOf(hireling) + 1).getLocation()); |
|
|
|
InterestManager.setObjectDirty(hireling); |
|
|
|
InterestManager.setObjectDirty(hireling); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -314,7 +314,7 @@ public enum BuildingManager { |
|
|
|
else |
|
|
|
else |
|
|
|
newGuild = building.getOwner().getGuild(); |
|
|
|
newGuild = building.getOwner().getGuild(); |
|
|
|
|
|
|
|
|
|
|
|
for (AbstractCharacter hireling : building.hirelings.keySet()) { |
|
|
|
for (AbstractCharacter hireling : building.hirelings) { |
|
|
|
hireling.setGuild(newGuild); |
|
|
|
hireling.setGuild(newGuild); |
|
|
|
WorldGrid.updateObject(hireling); |
|
|
|
WorldGrid.updateObject(hireling); |
|
|
|
} |
|
|
|
} |
|
|
@ -399,7 +399,7 @@ public enum BuildingManager { |
|
|
|
|
|
|
|
|
|
|
|
if (building.getRank() < 1) { |
|
|
|
if (building.getRank() < 1) { |
|
|
|
|
|
|
|
|
|
|
|
for (AbstractCharacter slottedNPC : building.hirelings.keySet()) |
|
|
|
for (AbstractCharacter slottedNPC : building.hirelings) |
|
|
|
BuildingManager.removeHireling(building, slottedNPC); |
|
|
|
BuildingManager.removeHireling(building, slottedNPC); |
|
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
@ -407,9 +407,9 @@ public enum BuildingManager { |
|
|
|
|
|
|
|
|
|
|
|
// Delete hireling if building has deranked.
|
|
|
|
// Delete hireling if building has deranked.
|
|
|
|
|
|
|
|
|
|
|
|
for (AbstractCharacter hireling : building.hirelings.keySet()) { |
|
|
|
for (AbstractCharacter hireling : building.hirelings) { |
|
|
|
|
|
|
|
|
|
|
|
if (building.hirelings.get(hireling) > building.getBlueprint().getSlotsForRank(building.getRank())) |
|
|
|
if (building.hirelings.indexOf(hireling) + 1 > building.getBlueprint().getSlotsForRank(building.getRank())) |
|
|
|
BuildingManager.removeHireling(building, hireling); |
|
|
|
BuildingManager.removeHireling(building, hireling); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|