summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llviewerobject.cpp12
-rw-r--r--indra/newview/llviewerregion.cpp6
2 files changed, 13 insertions, 5 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index df89e6759d..15207e7346 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -518,10 +518,18 @@ void LLViewerObject::setNameValueList(const std::string& name_value_list)
// agent.
bool LLViewerObject::isReturnable()
{
- LLBBox box_in_region_frame(getPositionRegion(), getRotationRegion(), getScale() * -0.5f, getScale() * 0.5f);
+ LLBBox bounding_box(getPositionRegion(), getRotationRegion(), getScale() * -0.5f, getScale() * 0.5f);
+ for (child_list_t::iterator iter = mChildList.begin();
+ iter != mChildList.end(); iter++)
+ {
+ LLViewerObject* child = *iter;
+ LLBBox child_box(child->getPositionRegion(), child->getRotationRegion(), child->getScale() * -0.5f, child->getScale() * 0.5f);
+ bounding_box.join(child_box);
+ }
+
return !isAttachment()
&& mRegionp
- && mRegionp->objectIsReturnable(getPositionRegion(), box_in_region_frame);
+ && mRegionp->objectIsReturnable(getPositionRegion(), bounding_box);
}
BOOL LLViewerObject::setParent(LLViewerObject* parent)
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index d9fd731ad3..43b26fe830 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1502,9 +1502,9 @@ const U32 ALLOW_RETURN_ENCROACHING_OBJECT = REGION_FLAGS_ALLOW_RETURN_ENCROACHIN
bool LLViewerRegion::objectIsReturnable(const LLVector3& pos, const LLBBox& bbox)
{
- return mParcelOverlay
- && ( (mParcelOverlay->isOwnedSelf(pos)
- || mParcelOverlay->isOwnedGroup(pos))
+ return (mParcelOverlay != NULL)
+ && (mParcelOverlay->isOwnedSelf(pos)
+ || mParcelOverlay->isOwnedGroup(pos)
|| ((mRegionFlags & ALLOW_RETURN_ENCROACHING_OBJECT)
&& mParcelOverlay->encroachesOwned(bbox)) );
}