From 2e3e4031653b80be9004b64bd584656ea5ef7395 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 31 Dec 2024 19:57:18 -0600 Subject: [PATCH] trouble shooting mine bug --- src/engine/objects/Mine.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index 1f40d21c..435d968f 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -78,8 +78,17 @@ public class Mine extends AbstractGameObject { 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(); + if(ZoneManager.getZoneByUUID(parent) != null) { + this.parentZone = ZoneManager.getZoneByUUID(parent); + this.zoneName = this.parentZone.getParent().getName(); + }else{ + this.parentZone = ZoneManager.getSeaFloor(); + this.zoneName = this.parentZone.getParent().getName(); + Logger.error("MINE FAILED TO LOAD PARENT: "); + Logger.error("MINE UID: " + rs.getInt("UID")); + Logger.error("MINE buildingID: " + buildingID); + + } this.owningGuild = Guild.getGuild(ownerUID); Guild nation = null;