New atomic boolean to lock down destruction

This commit is contained in:
2024-08-25 07:45:54 -04:00
parent 9ad5f239b0
commit 88a2f8687b
2 changed files with 13 additions and 3 deletions
+5 -2
View File
@@ -505,6 +505,11 @@ public class Building extends AbstractWorldObject {
return;
}
if (this.isDeranking.compareAndSet(false, true) == false) {
Logger.error("Attempt to derank tol twice");
return;
}
bane = city.getBane();
// We need to collect the spires and shrines on the citygrid in case
@@ -600,8 +605,6 @@ public class Building extends AbstractWorldObject {
newOwner = Guild.GetGL(bane.getOwner().getGuild());
this.isDeranking.compareAndSet(false, true);
if ((bane.getOwner().getGuild().getGuildState() == GuildState.Sovereign) ||
(bane.getOwner().getGuild().getGuildState() == GuildState.Protectorate) ||
(bane.getOwner().getGuild().getGuildState() == GuildState.Province) ||