forked from MagicBane/Server
TOL destroyed last in thread
This commit is contained in:
@@ -72,19 +72,19 @@ public class DestroyCityThread implements Runnable {
|
||||
|
||||
// By losing the tree, the former owners lose all of their subguilds.
|
||||
|
||||
if (formerGuild.getSubGuildList().isEmpty() == false) {
|
||||
if (!formerGuild.getSubGuildList().isEmpty()) {
|
||||
|
||||
subGuildList = new ArrayList<>();
|
||||
|
||||
for (Guild subGuild : formerGuild.getSubGuildList()) {
|
||||
subGuildList.add(subGuild);
|
||||
}
|
||||
subGuildList.addAll(formerGuild.getSubGuildList());
|
||||
|
||||
for (Guild subGuild : subGuildList) {
|
||||
formerGuild.removeSubGuild(subGuild);
|
||||
}
|
||||
}
|
||||
|
||||
Building tol = null;
|
||||
|
||||
// Build list of buildings within this parent zone
|
||||
|
||||
for (Building cityBuilding : cityZone.zoneBuildingSet) {
|
||||
@@ -100,6 +100,13 @@ public class DestroyCityThread implements Runnable {
|
||||
if (cityBuilding.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.BANESTONE))
|
||||
continue;
|
||||
|
||||
// TOL is processed after all other structures in the city zone
|
||||
|
||||
if (cityBuilding.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.TOL)) {
|
||||
tol = cityBuilding;
|
||||
continue;
|
||||
}
|
||||
|
||||
// All buildings are moved to a location relative
|
||||
// to their new parent zone
|
||||
|
||||
@@ -132,6 +139,11 @@ public class DestroyCityThread implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
// Destroy the tol
|
||||
|
||||
if (tol != null)
|
||||
BuildingManager.setRank(tol, -1);
|
||||
|
||||
if (city.getRealm() != null)
|
||||
city.getRealm().removeCity(city.getObjectUUID());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user