diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index e005df3d..899c24a2 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -36,8 +36,8 @@ public class Mine extends AbstractGameObject { public static ConcurrentHashMap mineMap = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW); public static ConcurrentHashMap towerMap = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW); - private final String zoneName; - private final Zone parentZone; + private String zoneName; + private Zone parentZone; public boolean isActive = false; public PlayerCharacter lastClaimer; public boolean wasClaimed = false; @@ -78,9 +78,14 @@ public class Mine extends AbstractGameObject { int ownerUID = rs.getInt("mine_ownerUID"); this.buildingID = rs.getInt("mine_buildingUID"); this.flags = rs.getInt("flags"); - int parent = rs.getInt("parent"); - this.parentZone = ZoneManager.getZoneByUUID(parent); - this.zoneName = this.parentZone.getParent().getName(); + //int parent = rs.getInt("parent"); + Building tower = BuildingManager.getBuildingFromCache(rs.getInt("mine_buildingUID")); + for(Zone zone : ZoneManager.getAllZonesIn(tower.loc)){ + if(zone.isMacroZone()) { + this.parentZone = zone; + this.zoneName = this.parentZone.getParent().getName(); + } + } this.owningGuild = Guild.getGuild(ownerUID); Guild nation = null;