mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 14:21:08 +00:00
ignore out of bounds values in RandomLocator
This commit is contained in:
+3
-1
@@ -41,7 +41,9 @@ public class RandomLocator implements Locator {
|
|||||||
|
|
||||||
BinaryColumn results = new BinaryColumn(column.getMinY(), column.getMaxY());
|
BinaryColumn results = new BinaryColumn(column.getMinY(), column.getMaxY());
|
||||||
for(int i = 0; i < size; i++) {
|
for(int i = 0; i < size; i++) {
|
||||||
results.set(height.get(r));
|
int h = height.get(r);
|
||||||
|
if(h >= column.getMaxY() || h < column.getMinY()) continue;
|
||||||
|
results.set(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
|
|||||||
Reference in New Issue
Block a user