summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelobject.cpp
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2021-08-27 17:29:09 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2021-08-27 17:29:09 +0300
commit9e4549117d86f686c50cc68b423eeb5f98999230 (patch)
tree05404638767c08bd9bf8f75b71a21caddf309652 /indra/newview/llpanelobject.cpp
parenta6833096c4593c78146b3e94a31e228302600b87 (diff)
SL-15887 FIXED Using Position buttons on an attachment that has a negative number for any position axii causes global position to be used
Diffstat (limited to 'indra/newview/llpanelobject.cpp')
-rw-r--r--indra/newview/llpanelobject.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp
index 6bff95ab36..5248ba31f5 100644
--- a/indra/newview/llpanelobject.cpp
+++ b/indra/newview/llpanelobject.cpp
@@ -1672,8 +1672,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);
-
- if ( LLWorld::getInstance()->positionRegionValidGlobal(new_pos_global) )
+ 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 (is_valid_pos)
{
// send only if the position is changed, that is, the delta vector is not zero
LLVector3d old_pos_global = mObject->getPositionGlobal();