diff options
Diffstat (limited to 'OpenSim/Data/SQLite/SQLiteRegionData.cs')
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteRegionData.cs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index 1d17bb9..08af7c3 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs | |||
@@ -581,13 +581,17 @@ namespace OpenSim.Data.SQLite | |||
581 | if (row.Read()) | 581 | if (row.Read()) |
582 | { | 582 | { |
583 | // TODO: put this into a function | 583 | // TODO: put this into a function |
584 | MemoryStream str = new MemoryStream((byte[]) row["Heightfield"]); | 584 | using (MemoryStream str = new MemoryStream((byte[])row["Heightfield"])) |
585 | BinaryReader br = new BinaryReader(str); | ||
586 | for (int x = 0; x < (int)Constants.RegionSize; x++) | ||
587 | { | 585 | { |
588 | for (int y = 0; y < (int)Constants.RegionSize; y++) | 586 | using (BinaryReader br = new BinaryReader(str)) |
589 | { | 587 | { |
590 | terret[x, y] = br.ReadDouble(); | 588 | for (int x = 0; x < (int)Constants.RegionSize; x++) |
589 | { | ||
590 | for (int y = 0; y < (int)Constants.RegionSize; y++) | ||
591 | { | ||
592 | terret[x, y] = br.ReadDouble(); | ||
593 | } | ||
594 | } | ||
591 | } | 595 | } |
592 | } | 596 | } |
593 | rev = (int) row["Revision"]; | 597 | rev = (int) row["Revision"]; |