diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llworldmap.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/linden/indra/newview/llworldmap.cpp b/linden/indra/newview/llworldmap.cpp index 3ada36f..bd3996d 100644 --- a/linden/indra/newview/llworldmap.cpp +++ b/linden/indra/newview/llworldmap.cpp | |||
@@ -237,15 +237,26 @@ LLSimInfo* LLWorldMap::simInfoFromPosGlobal(const LLVector3d& pos_global) | |||
237 | return simInfoFromHandle(handle); | 237 | return simInfoFromHandle(handle); |
238 | } | 238 | } |
239 | 239 | ||
240 | LLSimInfo* LLWorldMap::simInfoFromHandle(const U64 handle) | 240 | LLSimInfo* LLWorldMap::simInfoFromHandle(const U64 findhandle) |
241 | { | 241 | { |
242 | sim_info_map_t::iterator it = mSimInfoMap.find(handle); | 242 | std::map<U64, LLSimInfo*>::const_iterator it; |
243 | if (it != mSimInfoMap.end()) | 243 | for (it = LLWorldMap::getInstance()->mSimInfoMap.begin(); it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it) |
244 | { | 244 | { |
245 | LLSimInfo* sim_info = (*it).second; | 245 | const U64 handle = (*it).first; |
246 | if (sim_info) | 246 | LLSimInfo* info = (*it).second; |
247 | if(handle == findhandle) | ||
248 | { | ||
249 | return info; | ||
250 | } | ||
251 | U32 x = 0, y = 0; | ||
252 | from_region_handle(findhandle, &x, &y); | ||
253 | U32 checkRegionX, checkRegionY; | ||
254 | from_region_handle(handle, &checkRegionX, &checkRegionY); | ||
255 | |||
256 | if(x > checkRegionX && x < (checkRegionX + info->msizeX) && | ||
257 | y > checkRegionY && y < (checkRegionY + info->msizeY)) | ||
247 | { | 258 | { |
248 | return sim_info; | 259 | return info; |
249 | } | 260 | } |
250 | } | 261 | } |
251 | return NULL; | 262 | return NULL; |