diff options
Diffstat (limited to 'linden/indra/newview/llworldmap.cpp')
-rw-r--r-- | linden/indra/newview/llworldmap.cpp | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/linden/indra/newview/llworldmap.cpp b/linden/indra/newview/llworldmap.cpp index 3ada36f..ead72fa 100644 --- a/linden/indra/newview/llworldmap.cpp +++ b/linden/indra/newview/llworldmap.cpp | |||
@@ -237,16 +237,27 @@ 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 | { | 247 | if(handle == findhandle) |
248 | return sim_info; | 248 | { |
249 | } | 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)) | ||
258 | { | ||
259 | return info; | ||
260 | } | ||
250 | } | 261 | } |
251 | return NULL; | 262 | return NULL; |
252 | } | 263 | } |