Completed partial refactor.

This commit is contained in:
2023-10-08 09:59:13 -04:00
parent 4b62517d99
commit df54840a88
6 changed files with 27 additions and 72 deletions
+3 -3
View File
@@ -41,13 +41,13 @@ public class Terrain {
Zone terrain_zone = zone;
if (zone.getHeightMap() != null)
if (zone.terrain != null)
return zone;
if (zone.equals(ZoneManager.getSeaFloor()))
return zone;
while (terrain_zone.getHeightMap() == null)
while (terrain_zone.terrain == null)
terrain_zone = terrain_zone.parent;
return terrain_zone;
@@ -74,7 +74,7 @@ public class Terrain {
// Interpolate height for this position using pixel array.
float interpolatedTerrainHeight = terrainZone.getHeightMap().getInterpolatedTerrainHeight(terrainLoc);
float interpolatedTerrainHeight = terrainZone.terrain.getInterpolatedTerrainHeight(terrainLoc);
interpolatedTerrainHeight += terrainZone.worldAltitude;
return interpolatedTerrainHeight;