summaryrefslogtreecommitdiff
path: root/indra/newview/llinspectobject.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/llinspectobject.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/llinspectobject.cpp')
-rw-r--r--indra/newview/llinspectobject.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/indra/newview/llinspectobject.cpp b/indra/newview/llinspectobject.cpp
index f78a5cc64e..cb7031971b 100644
--- a/indra/newview/llinspectobject.cpp
+++ b/indra/newview/llinspectobject.cpp
@@ -28,16 +28,17 @@
#include "llinspectobject.h"
// Viewer
+#include "llagent.h" // To standup
#include "llfloatersidepanelcontainer.h"
#include "llinspect.h"
#include "llmediaentry.h"
-#include "llnotificationsutil.h" // *TODO: Eliminate, add LLNotificationsUtil wrapper
#include "llselectmgr.h"
#include "llslurl.h"
#include "llviewermenu.h" // handle_object_touch(), handle_buy()
#include "llviewermedia.h"
#include "llviewermediafocus.h"
#include "llviewerobjectlist.h" // to select the requested object
+#include "llvoavatarself.h"
// Linden libraries
#include "llbutton.h" // setLabel(), not virtual!
@@ -635,7 +636,31 @@ void LLInspectObject::onClickTouch()
void LLInspectObject::onClickSit()
{
- handle_object_sit_or_stand();
+ bool is_sitting = false;
+ if (mObjectSelection)
+ {
+ LLSelectNode* node = mObjectSelection->getFirstRootNode();
+ if (node && node->mValid)
+ {
+ LLViewerObject* root_object = node->getObject();
+ if (root_object
+ && isAgentAvatarValid()
+ && gAgentAvatarp->isSitting()
+ && gAgentAvatarp->getRoot() == root_object)
+ {
+ is_sitting = true;
+ }
+ }
+ }
+
+ if (is_sitting)
+ {
+ gAgent.standUp();
+ }
+ else
+ {
+ handle_object_sit(mObjectID);
+ }
closeFloater();
}