forked from MagicBane/Server
Need float value
This commit is contained in:
@@ -98,10 +98,10 @@ public class HeightMap {
|
|||||||
// Calculate the data we do not load from table
|
// Calculate the data we do not load from table
|
||||||
|
|
||||||
bucketCountX = this.heightmapImage.getWidth() - 1;
|
bucketCountX = this.heightmapImage.getWidth() - 1;
|
||||||
this.bucketWidthX = this.fullExtentsX / bucketCountX;
|
this.bucketWidthX = this.fullExtentsX / (float) bucketCountX;
|
||||||
|
|
||||||
bucketCountY = this.heightmapImage.getHeight() - 1;
|
bucketCountY = this.heightmapImage.getHeight() - 1;
|
||||||
this.bucketWidthY = this.fullExtentsY / bucketCountY;
|
this.bucketWidthY = this.fullExtentsY / (float) bucketCountY;
|
||||||
|
|
||||||
// Generate pixel array from image data
|
// Generate pixel array from image data
|
||||||
|
|
||||||
@@ -331,10 +331,10 @@ public class HeightMap {
|
|||||||
float yBucket = zoneLoc.y / this.bucketWidthY;
|
float yBucket = zoneLoc.y / this.bucketWidthY;
|
||||||
|
|
||||||
if (xBucket >= this.bucketCountX)
|
if (xBucket >= this.bucketCountX)
|
||||||
xBucket = this.bucketCountX - 1;
|
xBucket = xBucket - 1;
|
||||||
|
|
||||||
if (yBucket >= this.bucketCountY)
|
if (yBucket >= this.bucketCountY)
|
||||||
yBucket = this.bucketCountY - 1;
|
yBucket = xBucket - 1;
|
||||||
|
|
||||||
return new Vector2f(xBucket, yBucket);
|
return new Vector2f(xBucket, yBucket);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user