forked from MagicBane/Server
Merge branch 'feature-config-parsing2' into feature-config-usage
# Conflicts: # src/engine/powers/EffectsBase.java
This commit is contained in:
@@ -561,7 +561,7 @@ public class Building extends AbstractWorldObject {
|
||||
BuildingManager.setRank(barracksBuilding, -1);
|
||||
}
|
||||
|
||||
// If the tree is R8 and deranking, we need to update it's
|
||||
// If the tree is R8 and deranking, we need to update the
|
||||
// mesh along with buildings losing their health bonus
|
||||
|
||||
if (this.rank == 8) {
|
||||
|
||||
@@ -41,6 +41,7 @@ import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
||||
public class City extends AbstractWorldObject {
|
||||
@@ -80,6 +81,7 @@ public class City extends AbstractWorldObject {
|
||||
private String hash;
|
||||
public Warehouse warehouse;
|
||||
public Realm realm;
|
||||
public AtomicBoolean isDestroyed = new AtomicBoolean(false);
|
||||
|
||||
/**
|
||||
* ResultSet Constructor
|
||||
@@ -306,6 +308,21 @@ public class City extends AbstractWorldObject {
|
||||
if (city.parentZone == null)
|
||||
continue;
|
||||
|
||||
// Can't teleport to something without a tree
|
||||
|
||||
if (city.getTOL() == null)
|
||||
continue;
|
||||
|
||||
// No abandoned cities
|
||||
|
||||
if (city.getTOL().getGuild().isEmptyGuild())
|
||||
continue;
|
||||
|
||||
// No destroyed cities
|
||||
|
||||
if (city.getTOL().getRank() == -1)
|
||||
continue;
|
||||
|
||||
//can't repledge to a guild you're already part of
|
||||
|
||||
if (repledge && city.getGuild().equals(playerCharacter.guild))
|
||||
@@ -1102,17 +1119,21 @@ public class City extends AbstractWorldObject {
|
||||
|
||||
public final void destroy() {
|
||||
|
||||
Thread destroyCityThread = new Thread(new DestroyCityThread(this));
|
||||
if (this.isDestroyed.compareAndSet(false, true)) {
|
||||
|
||||
destroyCityThread.setName("destroyCity:" + this.getName());
|
||||
destroyCityThread.start();
|
||||
Thread destroyCityThread = new Thread(new DestroyCityThread(this));
|
||||
|
||||
destroyCityThread.setName("destroyCity:" + this.getParent().zoneName);
|
||||
destroyCityThread.start();
|
||||
} else
|
||||
Logger.error("Attempt to destroy destroyed city");
|
||||
}
|
||||
|
||||
public final void transfer(AbstractCharacter newOwner) {
|
||||
|
||||
Thread transferCityThread = new Thread(new TransferCityThread(this, newOwner));
|
||||
|
||||
transferCityThread.setName("TransferCity:" + this.getName());
|
||||
transferCityThread.setName("TransferCity:" + this.getParent().zoneName);
|
||||
transferCityThread.start();
|
||||
}
|
||||
|
||||
|
||||
@@ -220,8 +220,7 @@ public class Mine extends AbstractGameObject {
|
||||
// Only inactive mines are returned.
|
||||
|
||||
for (Mine mine : Mine.mineMap.keySet()) {
|
||||
if (mine.owningGuild.getObjectUUID() == guildID &&
|
||||
mine.isActive == false)
|
||||
if (mine.owningGuild.getObjectUUID() == guildID)
|
||||
mineList.add(mine);
|
||||
}
|
||||
return mineList;
|
||||
|
||||
Reference in New Issue
Block a user