Commits

Stinson Linden committed e5dcb8f

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.

Comments (0)

Files changed (3)

indra/newview/llselectmgr.cpp

 			object->flagCharacter() ||
 			object->flagVolumeDetect() ||
 			object->flagAnimSource() ||
+			(object->getRegion() != gAgent.getRegion()) ||
 			(!gAgent.isGodlike() && 
 			!gAgent.canManageEstate() &&
 			!object->permYouOwner() &&
 }
 
 //-----------------------------------------------------------------------------
+// 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.
 //-----------------------------------------------------------------------------

indra/newview/llselectmgr.h

 	BOOL selectGetNonCharacter();
 
 	BOOL selectGetEditableLinksets();
+	BOOL selectGetViewableCharacters();
 
 	// returns TRUE if selected objects can be transferred.
 	BOOL selectGetRootsTransfer();

indra/newview/llviewermenu.cpp

 
 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