diff --git a/src/engine/objects/Zone.java b/src/engine/objects/Zone.java index af9ecfa7..07b00520 100644 --- a/src/engine/objects/Zone.java +++ b/src/engine/objects/Zone.java @@ -229,31 +229,29 @@ public class Zone extends AbstractGameObject { this.parent = value; this.parentZoneID = (this.parent != null) ? this.parent.getObjectUUID() : 0; - if (this.parent != null) { - this.absX = this.xCoord + parent.absX; - this.absY = this.yCoord + parent.absY; - this.absZ = this.zCoord + parent.absZ; - - if (this.minLvl == 0 || this.maxLvl == 0) { - this.minLvl = this.parent.minLvl; - this.maxLvl = this.parent.maxLvl; - } - } else { //only the Sea Floor zone does not have a parent - this.absX = this.xCoord; - this.absY = MBServerStatics.SEA_FLOOR_ALTITUDE; - this.absZ = this.zCoord; - } - // Zone AABB is set here as it's coordinate space is world requiring a parent. + this.setBounds(); // Seafloor if (this.parent == null) { + this.absX = this.xCoord; + this.absY = MBServerStatics.SEA_FLOOR_ALTITUDE; + this.absZ = this.zCoord; this.seaLevel = 0; return; } + this.absX = this.xCoord + parent.absX; + this.absY = this.yCoord + parent.absY; + this.absZ = this.zCoord + parent.absZ; + + if (this.minLvl == 0 || this.maxLvl == 0) { + this.minLvl = this.parent.minLvl; + this.maxLvl = this.parent.maxLvl; + } + if (this.getHeightMap() != null && this.getHeightMap().getSeaLevel() != 0) this.seaLevel = this.worldAltitude + this.getHeightMap().getSeaLevel(); else