From bc5d0cc4a96cd444a14b56d0e40ecf08342ac6d8 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 8 Oct 2023 22:49:13 -0400 Subject: [PATCH] Terrain zone set in constructor --- src/engine/InterestManagement/Terrain.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/engine/InterestManagement/Terrain.java b/src/engine/InterestManagement/Terrain.java index 9901c3df..64144736 100644 --- a/src/engine/InterestManagement/Terrain.java +++ b/src/engine/InterestManagement/Terrain.java @@ -31,15 +31,17 @@ public class Terrain { public Terrain(Zone zone) { - this.heightmap = zone.terrain_image; + this.zone = zone; + + this.heightmap = this.zone.terrain_image; // Configure PLANAR - if (zone.terrain_type.equals("PLANAR")) + if (this.zone.terrain_type.equals("PLANAR")) this.heightmap = 1006300; - this.terrain_size.x = zone.major_radius; - this.terrain_size.y = zone.minor_radius; + this.terrain_size.x = this.zone.major_radius; + this.terrain_size.y = this.zone.minor_radius; this.terrain_pixel_data = Terrain._heightmap_pixel_cache.get(heightmap); @@ -52,7 +54,7 @@ public class Terrain { this.cell_size.x = terrain_size.x / this.cell_count.x; this.cell_size.y = terrain_size.y / this.cell_count.y; - this.terrain_scale = zone.terrain_max_y / 255f; + this.terrain_scale = this.zone.terrain_max_y / 255f; }