@ -331,9 +331,9 @@ public class HeightMap {
if (gridY < 0)
gridY = 0;
if (gridX > maxX)
if (gridX >= maxX)
gridX = maxX - 1;
if (gridY > maxY)
if (gridY >= maxY)
gridY = maxY - 1;
float offsetX = (gridSquare.x - gridX);