summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-09-28 19:43:24 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-09-28 19:50:27 +0300
commitb96348a2f9a360ce3b06c6e3759b96eac5d6726f (patch)
treef35b647d251624dfc82b808f9821dec4b9db9d70 /indra/newview/llviewermenu.cpp
parent454b029d9cb9455bdeb936a73d9033cbe0b0fcc9 (diff)
SL-16098 Unable to sit on an object using the 'Object inspector' floater
The same should probably be done for onClickTouch
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r--indra/newview/llviewermenu.cpp48
1 files changed, 32 insertions, 16 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 8b1d7b5e15..840089a1c2 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -4125,23 +4125,9 @@ bool is_object_sittable()
}
}
-
// only works on pie menu
-void handle_object_sit_or_stand()
+void handle_object_sit(LLViewerObject *object, const LLVector3 &offset)
{
- LLPickInfo pick = LLToolPie::getInstance()->getPick();
- LLViewerObject *object = pick.getObject();;
- if (!object || pick.mPickType == LLPickInfo::PICK_FLORA)
- {
- return;
- }
-
- if (sitting_on_selection())
- {
- gAgent.standUp();
- return;
- }
-
// get object selection offset
if (object && object->getPCode() == LL_PCODE_VOLUME)
@@ -4153,12 +4139,42 @@ void handle_object_sit_or_stand()
gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
gMessageSystem->nextBlockFast(_PREHASH_TargetObject);
gMessageSystem->addUUIDFast(_PREHASH_TargetID, object->mID);
- gMessageSystem->addVector3Fast(_PREHASH_Offset, pick.mObjectOffset);
+ gMessageSystem->addVector3Fast(_PREHASH_Offset, offset);
object->getRegion()->sendReliableMessage();
}
}
+void handle_object_sit_or_stand()
+{
+ LLPickInfo pick = LLToolPie::getInstance()->getPick();
+ LLViewerObject *object = pick.getObject();
+ if (!object || pick.mPickType == LLPickInfo::PICK_FLORA)
+ {
+ return;
+ }
+
+ if (sitting_on_selection())
+ {
+ gAgent.standUp();
+ return;
+ }
+
+ handle_object_sit(object, pick.mObjectOffset);
+}
+
+void handle_object_sit(const LLUUID& object_id)
+{
+ LLViewerObject* obj = gObjectList.findObject(object_id);
+ if (!obj)
+ {
+ return;
+ }
+
+ LLVector3 offset(0, 0, 0);
+ handle_object_sit(obj, offset);
+}
+
void near_sit_down_point(BOOL success, void *)
{
if (success)