diff options
Diffstat (limited to 'OpenSim/Framework/Data.MySQL')
-rw-r--r-- | OpenSim/Framework/Data.MySQL/MySQLDataStore.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs index fcc7cc1..9518724 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs | |||
@@ -374,12 +374,13 @@ namespace OpenSim.Framework.Data.MySQL | |||
374 | int rev = 0; | 374 | int rev = 0; |
375 | if (row.Read()) | 375 | if (row.Read()) |
376 | { | 376 | { |
377 | byte[] heightmap = (byte[]) row["Heightfield"]; | 377 | MemoryStream str = new MemoryStream((byte[]) row["Heightfield"]); |
378 | BinaryReader br = new BinaryReader(str); | ||
378 | for (int x = 0; x < 256; x++) | 379 | for (int x = 0; x < 256; x++) |
379 | { | 380 | { |
380 | for (int y = 0; y < 256; y++) | 381 | for (int y = 0; y < 256; y++) |
381 | { | 382 | { |
382 | terret[x, y] = BitConverter.ToDouble(heightmap, ((x*256) + y)*8); | 383 | terret[x, y] = br.ReadDouble(); |
383 | } | 384 | } |
384 | } | 385 | } |
385 | rev = (int) row["Revision"]; | 386 | rev = (int) row["Revision"]; |