summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-07-12 14:47:47 -0700
committerTodd Stinson <stinson@lindenlab.com>2012-07-12 14:47:47 -0700
commiteb00239a0b6b3177acd61a7261251cc2fdd5cb86 (patch)
treef93b52265affe5ad8a09312e0a228609b20a7054 /indra/newview
parente61785a45f7ad1ace4937423f421ea1f0b956e23 (diff)
PATH-807: Ensuring that the "Show in linksets..." and "Show in characters..." right-click menu option does not show for objects outside the current region.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llselectmgr.cpp25
-rw-r--r--indra/newview/llselectmgr.h1
-rw-r--r--indra/newview/llviewermenu.cpp2
3 files changed, 27 insertions, 1 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index a5d9db4a00..e711a51fe8 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -2806,6 +2806,7 @@ BOOL LLSelectMgr::selectGetEditableLinksets()
object->flagCharacter() ||
object->flagVolumeDetect() ||
object->flagAnimSource() ||
+ (object->getRegion() != gAgent.getRegion()) ||
(!gAgent.isGodlike() &&
!gAgent.canManageEstate() &&
!object->permYouOwner() &&
@@ -2818,6 +2819,30 @@ BOOL LLSelectMgr::selectGetEditableLinksets()
}
//-----------------------------------------------------------------------------
+// selectGetViewableCharacters() - return TRUE if all objects are characters
+// viewable within the pathfinding characters floater
+//-----------------------------------------------------------------------------
+BOOL LLSelectMgr::selectGetViewableCharacters()
+{
+ for (LLObjectSelection::iterator iter = getSelection()->begin();
+ iter != getSelection()->end(); iter++ )
+ {
+ LLSelectNode* node = *iter;
+ LLViewerObject* object = node->getObject();
+ if( !object || !node->mValid )
+ {
+ return FALSE;
+ }
+ if( !object->flagCharacter() ||
+ (object->getRegion() != gAgent.getRegion()))
+ {
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+
+//-----------------------------------------------------------------------------
// selectGetRootsTransfer() - return TRUE if current agent can transfer all
// selected root objects.
//-----------------------------------------------------------------------------
diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h
index feab6ebdf8..20d0a23267 100644
--- a/indra/newview/llselectmgr.h
+++ b/indra/newview/llselectmgr.h
@@ -585,6 +585,7 @@ public:
BOOL selectGetNonCharacter();
BOOL selectGetEditableLinksets();
+ BOOL selectGetViewableCharacters();
// returns TRUE if selected objects can be transferred.
BOOL selectGetRootsTransfer();
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 3eb0538328..b4ddc6039a 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -2809,7 +2809,7 @@ bool enable_object_select_in_pathfinding_linksets()
bool enable_object_select_in_pathfinding_characters()
{
- return LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion() && LLSelectMgr::getInstance()->selectGetCharacter();
+ return LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion() && LLSelectMgr::getInstance()->selectGetViewableCharacters();
}
class LLSelfRemoveAllAttachments : public view_listener_t