diff options
Diffstat (limited to 'indra/newview/llinspectobject.cpp')
-rw-r--r-- | indra/newview/llinspectobject.cpp | 29 |
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(); } |