TOL destroyed last in thread

This commit is contained in:
2024-03-18 06:46:28 -04:00
parent a30c041a17
commit 50171e4600
+16 -4
View File
@@ -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());