From 6ef33c5b7f03363d5e0c57c7bac7e9d8fb9b2185 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Tue, 12 Sep 2023 15:27:00 -0400 Subject: [PATCH] Update to world altitude calculation --- src/engine/gameManager/ZoneManager.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/engine/gameManager/ZoneManager.java b/src/engine/gameManager/ZoneManager.java index 925c75a9..f631f0ed 100644 --- a/src/engine/gameManager/ZoneManager.java +++ b/src/engine/gameManager/ZoneManager.java @@ -459,15 +459,21 @@ public enum ZoneManager { float worldAlttitude = MBServerStatics.SEA_FLOOR_ALTITUDE; - if (getSeaFloor().getObjectUUID() == zone.getObjectUUID()) { + + // Seafloor + + if (zone.getParent() == null) { return worldAlttitude; } Zone parentZone = zone.getParent(); - if (getSeaFloor().getObjectUUID() == parentZone.getObjectUUID()) { + // Child of seafloor + + if (parentZone.getParent() == null) return worldAlttitude + zone.getYCoord(); - } + + // return height from heightmap engine at zone location worldAlttitude = HeightMap.getWorldHeight(parentZone, zone.getLoc());