summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelobject.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2022-06-29 20:32:13 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2022-06-29 20:32:13 +0300
commita7c9ca896069ce84d8c9798e36a5fc75d5ac9939 (patch)
tree404e59ab738fe61d42bfc9780c4d8fa8bb25f423 /indra/newview/llpanelobject.cpp
parent10ab905c96bf979827951146d22e98214bf5a310 (diff)
parent1e4f2ec07e32a142f35817d3186a124df3f8cd25 (diff)
Merge branch 'master' into DRTVWR-561-maint-O
Diffstat (limited to 'indra/newview/llpanelobject.cpp')
-rw-r--r--indra/newview/llpanelobject.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp
index 1fd1784d4b..0bfc1297d3 100644
--- a/indra/newview/llpanelobject.cpp
+++ b/indra/newview/llpanelobject.cpp
@@ -1689,8 +1689,19 @@ void LLPanelObject::sendPosition(BOOL btn_down)
// Make sure new position is in a valid region, so the object
// won't get dumped by the simulator.
LLVector3d new_pos_global = regionp->getPosGlobalFromRegion(newpos);
+ bool is_valid_pos = true;
+ if (mObject->isAttachment())
+ {
+ LLVector3 delta_pos = mObject->getPositionEdit() - newpos;
+ LLVector3d attachment_pos = regionp->getPosGlobalFromRegion(mObject->getPositionRegion() + delta_pos);
+ is_valid_pos = LLWorld::getInstance()->positionRegionValidGlobal(attachment_pos);
+ }
+ else
+ {
+ is_valid_pos = LLWorld::getInstance()->positionRegionValidGlobal(new_pos_global);
+ }
- if ( LLWorld::getInstance()->positionRegionValidGlobal(new_pos_global) )
+ if (is_valid_pos)
{
// send only if the position is changed, that is, the delta vector is not zero
LLVector3d old_pos_global = mObject->getPositionGlobal();