From ebdc64730a832a6e5dc2dc7d304eff813c73e933 Mon Sep 17 00:00:00 2001 From: MW Date: Tue, 10 Jul 2007 18:58:42 +0000 Subject: Fixed the crashing when trying to look at the map in grid mode. Although the textures for the regions don't seem to show up, about to look into that. --- .../Region/Communications/OGS1/OGS1GridServices.cs | 23 ++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/Communications/OGS1') diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 50a31c6..1cadf9b 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -151,20 +151,23 @@ namespace OpenSim.Region.Communications.OGS1 List neighbours = new List(); - foreach (Hashtable n in (Hashtable)respData.Values) + foreach (ArrayList a in respData.Values) { - MapBlockData neighbour = new MapBlockData(); + foreach (Hashtable n in a) + { + MapBlockData neighbour = new MapBlockData(); - neighbour.X = (ushort)n["x"]; - neighbour.Y = (ushort)n["y"]; + neighbour.X = Convert.ToUInt16(n["x"]); + neighbour.Y = Convert.ToUInt16(n["y"]); - neighbour.Name = (string)n["name"]; - neighbour.Access = (byte)n["access"]; - neighbour.RegionFlags = (uint)n["region-flags"]; - neighbour.WaterHeight = (byte)n["water-height"]; - neighbour.MapImageId = (string)n["map-image-id"]; + neighbour.Name = (string)n["name"]; + neighbour.Access = Convert.ToByte(n["access"]); + neighbour.RegionFlags = Convert.ToUInt32(n["region-flags"]); + neighbour.WaterHeight = Convert.ToByte(n["water-height"]); + neighbour.MapImageId = (string)n["map-image-id"]; - neighbours.Add(neighbour); + neighbours.Add(neighbour); + } } return neighbours; -- cgit v1.1