From 2c0899982c1b4e96f4ad2f33428c0e1ec88715f4 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 18 Apr 2024 20:50:15 -0500 Subject: [PATCH] mine audit --- src/engine/objects/Mine.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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;