Browse Source

TOL destroyed last in thread

combat-2
MagicBot 8 months ago
parent
commit
50171e4600
  1. 20
      src/engine/workthreads/DestroyCityThread.java

20
src/engine/workthreads/DestroyCityThread.java

@ -72,19 +72,19 @@ public class DestroyCityThread implements Runnable { @@ -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 { @@ -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 { @@ -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());

Loading…
Cancel
Save