diff --git a/src/engine/InterestManagement/Terrain.java b/src/engine/InterestManagement/Terrain.java index 16a6a4a2..1bf98daa 100644 --- a/src/engine/InterestManagement/Terrain.java +++ b/src/engine/InterestManagement/Terrain.java @@ -172,6 +172,8 @@ public class Terrain { if (this.zone.guild_zone) return 5.0f; + // Determine terrain and offset from top left vertex + Vector2f terrain_cell = getTerrainCell(terrain_loc); int pixel_x = (int) Math.floor(terrain_cell.x); @@ -181,10 +183,10 @@ public class Terrain { // 4 surrounding vertices from the pixel array. - float top_left_pixel = terrain_pixel_data[pixel_x][pixel_y]; - float top_right_pixel = terrain_pixel_data[pixel_x + 1][pixel_y]; - float bottom_left_pixel = terrain_pixel_data[pixel_x][pixel_y + 1]; - float bottom_right_pixel = terrain_pixel_data[pixel_x + 1][pixel_y + 1]; + short top_left_pixel = terrain_pixel_data[pixel_x][pixel_y]; + short top_right_pixel = terrain_pixel_data[pixel_x + 1][pixel_y]; + short bottom_left_pixel = terrain_pixel_data[pixel_x][pixel_y + 1]; + short bottom_right_pixel = terrain_pixel_data[pixel_x + 1][pixel_y + 1]; // Interpolate between the 4 vertices