From 6572f0c805a3f4f69f654c7a015783de0c7942b4 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 18 Nov 2023 13:20:17 -0500 Subject: [PATCH] Clamp fix for new method --- src/engine/InterestManagement/Terrain.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/InterestManagement/Terrain.java b/src/engine/InterestManagement/Terrain.java index 8efe03fd..94ed5d48 100644 --- a/src/engine/InterestManagement/Terrain.java +++ b/src/engine/InterestManagement/Terrain.java @@ -164,8 +164,8 @@ public class Terrain { // Clamp values when standing directly on pole - terrain_cell.x = Math.max(0, Math.min(this.cell_count.x - 1, terrain_cell.x)); - terrain_cell.y = Math.max(0, Math.min(this.cell_count.y - 1, terrain_cell.y)); + terrain_cell.x = Math.max(0, Math.min(this.cell_count.x - 2, terrain_cell.x)); + terrain_cell.y = Math.max(0, Math.min(this.cell_count.y - 2, terrain_cell.y)); return terrain_cell; }