diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/WorldMap')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs index 9dbe225..bc62e07 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs | |||
@@ -248,8 +248,42 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
248 | public virtual void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag) | 248 | public virtual void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag) |
249 | { | 249 | { |
250 | List<MapBlockData> mapBlocks; | 250 | List<MapBlockData> mapBlocks; |
251 | mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks(minX - 4, minY - 4, minX + 4, minY + 4); | 251 | if ((flag & 0x10000) != 0) // user clicked on the map a tile that isn't visible |
252 | remoteClient.SendMapBlock(mapBlocks, flag); | 252 | { |
253 | List<MapBlockData> response = new List<MapBlockData>(); | ||
254 | |||
255 | // this should return one mapblock at most. But make sure: Look whether the one we requested is in there | ||
256 | mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks(minX, minY, maxX, maxY); | ||
257 | if (mapBlocks != null) | ||
258 | { | ||
259 | foreach (MapBlockData block in mapBlocks) | ||
260 | { | ||
261 | if (block.X == minX && block.Y == minY) | ||
262 | { | ||
263 | // found it => add it to response | ||
264 | response.Add(block); | ||
265 | break; | ||
266 | } | ||
267 | } | ||
268 | } | ||
269 | |||
270 | if (response.Count == 0) | ||
271 | { | ||
272 | // response still empty => couldn't find the map-tile the user clicked on => tell the client | ||
273 | MapBlockData block = new MapBlockData(); | ||
274 | block.X = (ushort)minX; | ||
275 | block.Y = (ushort)minY; | ||
276 | block.Access = 254; // == not there | ||
277 | response.Add(block); | ||
278 | } | ||
279 | remoteClient.SendMapBlock(response, 0); | ||
280 | } | ||
281 | else | ||
282 | { | ||
283 | // normal mapblock request. Use the provided values | ||
284 | mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks(minX - 4, minY - 4, maxX + 4, maxY + 4); | ||
285 | remoteClient.SendMapBlock(mapBlocks, flag); | ||
286 | } | ||
253 | } | 287 | } |
254 | 288 | ||
255 | public Hashtable OnHTTPGetMapImage(Hashtable keysvals) | 289 | public Hashtable OnHTTPGetMapImage(Hashtable keysvals) |