diff options
| author | Todd Stinson <stinson@lindenlab.com> | 2012-03-29 18:07:40 -0700 |
|---|---|---|
| committer | Todd Stinson <stinson@lindenlab.com> | 2012-03-29 18:07:40 -0700 |
| commit | fcda925072c51de749e6b35b3863f29d8be3eaa6 (patch) | |
| tree | c3e0662b3c5f9dabaa2e046a21861bf0a9434d2a /indra/newview/llselectmgr.cpp | |
| parent | f90bcb3a55a0e61f3dbf068c3ddea86b6d5f519f (diff) | |
PATH-450: BUGFIX Ensuring that permanent objects cannot be linked in frozen mode. Displaying a modal notification if user attempts.
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
| -rw-r--r-- | indra/newview/llselectmgr.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index b0aae89a85..44a0b3adc4 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -593,6 +593,12 @@ bool LLSelectMgr::linkObjects() return true; } + if (!LLSelectMgr::getInstance()->selectGetRootsNonPermanent()) + { + LLNotificationsUtil::add("CannotLinkPermanent"); + return true; + } + LLUUID owner_id; std::string owner_name; if (!LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name)) @@ -2499,6 +2505,54 @@ BOOL LLSelectMgr::selectGetRootsModify() //----------------------------------------------------------------------------- +// selectGetPermanent() - return TRUE if current agent can modify all +// selected objects. +//----------------------------------------------------------------------------- +BOOL LLSelectMgr::selectGetNonPermanent() +{ + 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->isPermanentEnforced()) + { + return FALSE; + } + } + return TRUE; +} + +//----------------------------------------------------------------------------- +// selectGetRootsModify() - return TRUE if current agent can modify all +// selected root objects. +//----------------------------------------------------------------------------- +BOOL LLSelectMgr::selectGetRootsNonPermanent() +{ + for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); + iter != getSelection()->root_end(); iter++ ) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + if( !node->mValid ) + { + return FALSE; + } + if( object->isPermanentEnforced()) + { + return FALSE; + } + } + + return TRUE; +} + + +//----------------------------------------------------------------------------- // selectGetRootsTransfer() - return TRUE if current agent can transfer all // selected root objects. //----------------------------------------------------------------------------- |
