From 83be09d643d5ee9c503df4488527f2b4bcd52161 Mon Sep 17 00:00:00 2001
From: MagicBot <MagicBot@magicbane.com>
Date: Sun, 17 Sep 2023 12:49:30 -0400
Subject: [PATCH] Comment and name cleanup

---
 src/engine/InterestManagement/HeightMap.java | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/engine/InterestManagement/HeightMap.java b/src/engine/InterestManagement/HeightMap.java
index f7eb71fe..93fa7996 100644
--- a/src/engine/InterestManagement/HeightMap.java
+++ b/src/engine/InterestManagement/HeightMap.java
@@ -212,7 +212,7 @@ public class HeightMap {
         Zone heightMapZone;
         Zone parentZone;
         float worldHeight;
-        float parentHeight;
+        float interpolatedParentTerrainHeight;
 
         //  Seafloor is rather flat.
 
@@ -242,11 +242,11 @@ public class HeightMap {
         // We will need the parent height if we got this far into the method
 
         parentZone = HeightMap.getNextZoneWithTerrain(heightMapZone.getParent());
-        parentHeight = HeightMap.getWorldHeight(parentZone, worldLoc);
+        interpolatedParentTerrainHeight = HeightMap.getWorldHeight(parentZone, worldLoc);
 
-        if (Bounds.collide(worldLoc, heightMapZone.minBlend) == true) {
+        // Between maxBlend and minBlend distance from edge of zone we LERP between the two heights
 
-            // How far into blend zone are we?
+        if (Bounds.collide(worldLoc, heightMapZone.minBlend) == true) {
 
             Bounds blendBounds = Bounds.borrow();
             zoneLoc.x = abs(zoneLoc.x);
@@ -260,14 +260,14 @@ public class HeightMap {
 
             float areaDelta = childArea / parentArea;
 
-            interpolatedTerrainHeight = FastMath.LERP(areaDelta, interpolatedTerrainHeight, parentHeight);
+            interpolatedTerrainHeight = FastMath.LERP(areaDelta, interpolatedTerrainHeight, interpolatedParentTerrainHeight);
             return interpolatedTerrainHeight + heightMapZone.worldAltitude;
 
         }
 
         // Past min blend we just return the parent height.
 
-        return parentHeight + heightMapZone.worldAltitude;
+        return interpolatedParentTerrainHeight + heightMapZone.worldAltitude;
 
     }