From dd5fc323efe45bcd96627fc0b7d5b6415aae973f Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 11 Sep 2023 14:06:22 -0400 Subject: [PATCH] bugfix in array loading --- 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 0abf12fa..ff03dbce 100644 --- a/src/engine/InterestManagement/HeightMap.java +++ b/src/engine/InterestManagement/HeightMap.java @@ -137,10 +137,10 @@ public class HeightMap { this.bucketWidthX = halfExtentsX; this.bucketWidthY = halfExtentsY; - this.pixelColorValues = new int[this.fullExtentsX + 1][this.fullExtentsY + 1]; + this.pixelColorValues = new int[this.fullExtentsX][this.fullExtentsY]; - for (int y = 0; y <= this.fullExtentsY; y++) { - for (int x = 0; x <= this.fullExtentsX; x++) { + for (int y = 0; y < this.fullExtentsY; y++) { + for (int x = 0; x < this.fullExtentsX; x++) { pixelColorValues[x][y] = 0; } } @@ -172,10 +172,10 @@ public class HeightMap { this.bucketWidthX = halfExtentsX; this.bucketWidthY = halfExtentsY; - this.pixelColorValues = new int[this.fullExtentsX + 1][this.fullExtentsY + 1]; + this.pixelColorValues = new int[this.fullExtentsX][this.fullExtentsY]; - for (int y = 0; y <= this.fullExtentsY; y++) { - for (int x = 0; x <= this.fullExtentsX; x++) { + for (int y = 0; y < this.fullExtentsY; y++) { + for (int x = 0; x < this.fullExtentsX; x++) { pixelColorValues[x][y] = 0; } }