Browse Source

fixed AbstractHeightMap bounds check, thanks ozonegrif

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7830 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
bre..ns 14 years ago
parent
commit
08e5d1a68f

+ 2 - 2
engine/src/terrain/com/jme3/terrain/heightmap/AbstractHeightMap.java

@@ -184,7 +184,7 @@ public abstract class AbstractHeightMap implements HeightMap {
 
 
         low = getScaledHeightAtPoint((int) x, (int) z);
         low = getScaledHeightAtPoint((int) x, (int) z);
 
 
-        if (x + 1 > size) {
+        if (x + 1 >= size) {
             return low;
             return low;
         }
         }
 
 
@@ -193,7 +193,7 @@ public abstract class AbstractHeightMap implements HeightMap {
         interpolation = x - (int) x;
         interpolation = x - (int) x;
         intX = ((highX - low) * interpolation) + low;
         intX = ((highX - low) * interpolation) + low;
 
 
-        if (z + 1 > size) {
+        if (z + 1 >= size) {
             return low;
             return low;
         }
         }