From ab14173aaacbf3f5dc15aab1d4a452f29c0ab0a4 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Tue, 21 Mar 2023 03:09:39 -0400 Subject: [PATCH] Account for vorringia parenting. --- src/engine/InterestManagement/HeightMap.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/engine/InterestManagement/HeightMap.java b/src/engine/InterestManagement/HeightMap.java index ec46998a..c903031a 100644 --- a/src/engine/InterestManagement/HeightMap.java +++ b/src/engine/InterestManagement/HeightMap.java @@ -425,21 +425,30 @@ public class HeightMap { Zone parentZone = currentZone.getParent(); HeightMap heightMap = currentZone.getHeightMap(); + //find the next parents heightmap if the currentzone heightmap is null. + while (heightMap == null) { - if (currentZone == ZoneManager.getSeaFloor()) { + if (currentZone == ZoneManager.getSeaFloor()) break; - } + currentZone = currentZone.getParent(); heightMap = currentZone.getHeightMap(); parentZone = currentZone.getParent(); + + // Account for databases where the continental + // heightmaps are driven by the zone above them. + + if (parentZone.getHeightMap() == null) + parentZone = parentZone.getParent(); + } - if ((heightMap == null) || (currentZone == ZoneManager.getSeaFloor())) { + if ((heightMap == null) || (currentZone == ZoneManager.getSeaFloor())) return currentZone.getAbsY(); - } + Vector2f zoneLoc = ZoneManager.worldToZoneSpace(worldLoc, currentZone); Vector3fImmutable localLocFromCenter = ZoneManager.worldToLocal(worldLoc, currentZone);