diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index c360b8f9..34b3c576 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -81,38 +81,41 @@ public class Mine extends AbstractGameObject { this.buildingID = rs.getInt("mine_buildingUID"); this.flags = rs.getInt("flags"); //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(); + if(BuildingManager.getBuildingFromCache(rs.getInt("mine_buildingUID")) != null) { + 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; + this.owningGuild = Guild.getGuild(ownerUID); + Guild nation = null; + + if (this.owningGuild.isEmptyGuild()) { + this.guildName = ""; + this.guildTag = GuildTag.ERRANT; + nation = Guild.getErrantGuild(); + this.owningGuild = Guild.getErrantGuild(); + } else { + this.guildName = this.owningGuild.getName(); + this.guildTag = this.owningGuild.getGuildTag(); + nation = this.owningGuild.getNation(); + } - if (this.owningGuild.isEmptyGuild()) { - this.guildName = ""; - this.guildTag = GuildTag.ERRANT; - nation = Guild.getErrantGuild(); - this.owningGuild = Guild.getErrantGuild(); - } else { - this.guildName = this.owningGuild.getName(); - this.guildTag = this.owningGuild.getGuildTag(); - nation = this.owningGuild.getNation(); - } + if (!nation.isEmptyGuild()) { + this.nationName = nation.getName(); + this.nationTag = nation.getGuildTag(); + } else { + this.nationName = ""; + this.nationTag = GuildTag.ERRANT; + } - if (!nation.isEmptyGuild()) { - this.nationName = nation.getName(); - this.nationTag = nation.getGuildTag(); - } else { - this.nationName = ""; - this.nationTag = GuildTag.ERRANT; + this.production = Resource.valueOf(rs.getString("mine_resource")); + this.lastClaimer = null; } - - this.production = Resource.valueOf(rs.getString("mine_resource")); - this.lastClaimer = null; } public static void SetTimes(){ @@ -150,7 +153,7 @@ public class Mine extends AbstractGameObject { AmericaMines.get(10).liveTime = 1; AmericaMines.get(11).liveTime = 1; AmericaMines.get(12).liveTime = 1; - AmericaMines.get(13).liveTime = 1; + //AmericaMines.get(13).liveTime = 1; int count = 1;