aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs')
-rw-r--r--OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs b/OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs
index a724875..5d9580e 100644
--- a/OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs
+++ b/OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs
@@ -436,12 +436,13 @@ namespace OpenSim.Framework.Data.SQLite
436 if (row.Read()) 436 if (row.Read())
437 { 437 {
438 // TODO: put this into a function 438 // TODO: put this into a function
439 byte[] heightmap = (byte[]) row["Heightfield"]; 439 MemoryStream str = new MemoryStream((byte[]) row["Heightfield"]);
440 BinaryReader br = new BinaryReader(str);
440 for (int x = 0; x < 256; x++) 441 for (int x = 0; x < 256; x++)
441 { 442 {
442 for (int y = 0; y < 256; y++) 443 for (int y = 0; y < 256; y++)
443 { 444 {
444 terret[x, y] = BitConverter.ToDouble(heightmap, ((x*256) + y)*8); 445 terret[x, y] = br.ReadDouble();
445 } 446 }
446 } 447 }
447 rev = (int) row["Revision"]; 448 rev = (int) row["Revision"];