diff options
-rwxr-xr-x | indra/newview/llviewerregion.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 11cbf3fc24..7a6637c0a1 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1485,6 +1485,12 @@ void LLViewerRegion::killObject(LLVOCacheEntry* entry, std::vector<LLDrawable*>& if(drawablep && !drawablep->getParent()) { + if (drawablep->getVObj()->isSelected()) + { + // do not remove selected objects + ((LLViewerOctreeEntryData*)drawablep)->setVisible(); + return; + } LLViewerObject::const_child_list_t& child_list = drawablep->getVObj()->getChildren(); for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); iter != child_list.end(); iter++) @@ -1492,9 +1498,9 @@ void LLViewerRegion::killObject(LLVOCacheEntry* entry, std::vector<LLDrawable*>& LLViewerObject* child = *iter; if(child->mDrawable) { - if(!child->mDrawable->getEntry() || !child->mDrawable->getEntry()->hasVOCacheEntry()) + if(!child->mDrawable->getEntry() || !child->mDrawable->getEntry()->hasVOCacheEntry() || child->isSelected()) { - //do not remove parent if any of its children non-cacheable + //do not remove parent if any of its children non-cacheable or selected //especially for the case that an avatar sits on a cache-able object ((LLViewerOctreeEntryData*)drawablep)->setVisible(); return; |