Repair database routines so they properly return null when asked for
the heighmap of a region that does not exist.0.8.0.3
parent
8eec717f5f
commit
e5d59dc696
|
@ -531,10 +531,14 @@ ELSE
|
|||
/// <returns></returns>
|
||||
public double[,] LoadTerrain(UUID regionID)
|
||||
{
|
||||
double[,] ret = null;
|
||||
TerrainData terrData = LoadTerrain(regionID, (int)Constants.RegionSize, (int)Constants.RegionSize, (int)Constants.RegionHeight);
|
||||
return terrData.GetDoubles();
|
||||
if (terrData != null)
|
||||
ret = terrData.GetDoubles();
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Returns 'null' if region not found
|
||||
public TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ)
|
||||
{
|
||||
TerrainData terrData = null;
|
||||
|
|
|
@ -616,10 +616,14 @@ namespace OpenSim.Data.MySQL
|
|||
// Legacy region loading
|
||||
public double[,] LoadTerrain(UUID regionID)
|
||||
{
|
||||
double[,] ret = null;
|
||||
TerrainData terrData = LoadTerrain(regionID, (int)Constants.RegionSize, (int)Constants.RegionSize, (int)Constants.RegionHeight);
|
||||
return terrData.GetDoubles();
|
||||
if (terrData != null)
|
||||
ret = terrData.GetDoubles();
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Returns 'null' if region not found
|
||||
public TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ)
|
||||
{
|
||||
TerrainData terrData = null;
|
||||
|
|
|
@ -148,6 +148,7 @@ namespace OpenSim.Data.Null
|
|||
}
|
||||
|
||||
// Legacy. Just don't do this.
|
||||
// Returns 'null' if region not found
|
||||
public double[,] LoadTerrain(UUID regionID)
|
||||
{
|
||||
if (m_terrains.ContainsKey(regionID))
|
||||
|
|
|
@ -524,10 +524,14 @@ namespace OpenSim.Data.PGSQL
|
|||
/// <returns></returns>
|
||||
public double[,] LoadTerrain(UUID regionID)
|
||||
{
|
||||
double[,] ret = null;
|
||||
TerrainData terrData = LoadTerrain(regionID, (int)Constants.RegionSize, (int)Constants.RegionSize, (int)Constants.RegionHeight);
|
||||
return terrData.GetDoubles();
|
||||
if (terrData != null)
|
||||
ret = terrData.GetDoubles();
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Returns 'null' if region not found
|
||||
public TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ)
|
||||
{
|
||||
TerrainData terrData = null;
|
||||
|
|
|
@ -870,10 +870,14 @@ namespace OpenSim.Data.SQLite
|
|||
/// <returns>Heightfield data</returns>
|
||||
public double[,] LoadTerrain(UUID regionID)
|
||||
{
|
||||
double[,] ret = null;
|
||||
TerrainData terrData = LoadTerrain(regionID, (int)Constants.RegionSize, (int)Constants.RegionSize, (int)Constants.RegionHeight);
|
||||
return terrData.GetDoubles();
|
||||
if (terrData != null)
|
||||
ret = terrData.GetDoubles();
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Returns 'null' if region not found
|
||||
public TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ)
|
||||
{
|
||||
TerrainData terrData = null;
|
||||
|
|
Loading…
Reference in New Issue