diff options
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLRegionData.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index 09564de..2166845 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs | |||
@@ -583,16 +583,16 @@ namespace OpenSim.Data.MySQL | |||
583 | { | 583 | { |
584 | while (reader.Read()) | 584 | while (reader.Read()) |
585 | { | 585 | { |
586 | terrain = new double[256,256]; | 586 | terrain = new double[(int)Constants.RegionSize, (int)Constants.RegionSize]; |
587 | terrain.Initialize(); | 587 | terrain.Initialize(); |
588 | 588 | ||
589 | MemoryStream mstr = new MemoryStream((byte[]) reader["Heightfield"]); | 589 | MemoryStream mstr = new MemoryStream((byte[]) reader["Heightfield"]); |
590 | int rev = 0; | 590 | int rev = 0; |
591 | 591 | ||
592 | BinaryReader br = new BinaryReader(mstr); | 592 | BinaryReader br = new BinaryReader(mstr); |
593 | for (int x = 0; x < 256; x++) | 593 | for (int x = 0; x < (int)Constants.RegionSize; x++) |
594 | { | 594 | { |
595 | for (int y = 0; y < 256; y++) | 595 | for (int y = 0; y < (int)Constants.RegionSize; y++) |
596 | { | 596 | { |
597 | terrain[x, y] = br.ReadDouble(); | 597 | terrain[x, y] = br.ReadDouble(); |
598 | } | 598 | } |
@@ -1141,12 +1141,12 @@ namespace OpenSim.Data.MySQL | |||
1141 | /// <returns></returns> | 1141 | /// <returns></returns> |
1142 | private static Array SerializeTerrain(double[,] val) | 1142 | private static Array SerializeTerrain(double[,] val) |
1143 | { | 1143 | { |
1144 | MemoryStream str = new MemoryStream(65536*sizeof (double)); | 1144 | MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize) *sizeof (double)); |
1145 | BinaryWriter bw = new BinaryWriter(str); | 1145 | BinaryWriter bw = new BinaryWriter(str); |
1146 | 1146 | ||
1147 | // TODO: COMPATIBILITY - Add byte-order conversions | 1147 | // TODO: COMPATIBILITY - Add byte-order conversions |
1148 | for (int x = 0; x < 256; x++) | 1148 | for (int x = 0; x < (int)Constants.RegionSize; x++) |
1149 | for (int y = 0; y < 256; y++) | 1149 | for (int y = 0; y < (int)Constants.RegionSize; y++) |
1150 | { | 1150 | { |
1151 | double height = val[x, y]; | 1151 | double height = val[x, y]; |
1152 | if (height == 0.0) | 1152 | if (height == 0.0) |