|
@@ -191,8 +191,16 @@ public class GeoData
|
|
|
*/
|
|
|
public int getSpawnHeight(int x, int y, int z)
|
|
|
{
|
|
|
- int nearestZ = getNearestZ(getGeoX(x), getGeoY(y), z + 100);
|
|
|
- return Math.abs(nearestZ - z) <= SPAWN_Z_DELTA_LIMIT ? nearestZ : z;
|
|
|
+ final int geoX = getGeoX(x);
|
|
|
+ final int geoY = getGeoY(y);
|
|
|
+
|
|
|
+ if (!hasGeoPos(geoX, geoY))
|
|
|
+ {
|
|
|
+ return z;
|
|
|
+ }
|
|
|
+
|
|
|
+ int nextLowerZ = getNextLowerZ(geoX, geoY, z + 100);
|
|
|
+ return Math.abs(nextLowerZ - z) <= SPAWN_Z_DELTA_LIMIT ? nextLowerZ : z;
|
|
|
}
|
|
|
|
|
|
/**
|