- fixed : user shouldn't be able to toggle running, reset or save an open script that's inside of a locked attachment

--HG--
branch : RLVa
meow-7.2.2
Kitty Barnett 2010-09-28 12:37:18 +02:00
parent 873087b791
commit fb0034e597
1 changed files with 20 additions and 4 deletions

View File

@ -83,6 +83,9 @@
#include "lltrans.h"
#include "llviewercontrol.h"
#include "llappviewer.h"
// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f)
#include "rlvhandler.h"
// [/RLVa:KB]
const std::string HELLO_LSL =
"default\n"
@ -1683,6 +1686,13 @@ void LLLiveLSLEditor::onRunningCheckboxClicked( LLUICtrl*, void* userdata )
//self->mRunningCheckbox->get();
if( object )
{
// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.5a
if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.isLockedAttachment(object->getRootEdit())) )
{
return;
}
// [/RLVa:KB]
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_SetScriptRunning);
msg->nextBlockFast(_PREHASH_AgentData);
@ -1708,6 +1718,13 @@ void LLLiveLSLEditor::onReset(void *userdata)
LLViewerObject* object = gObjectList.findObject( self->mObjectUUID );
if(object)
{
// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.5a
if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.isLockedAttachment(object->getRootEdit())) )
{
return;
}
// [/RLVa:KB]
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ScriptReset);
msg->nextBlockFast(_PREHASH_AgentData);
@ -2117,13 +2134,12 @@ void LLLiveLSLEditor::onSave(void* userdata, BOOL close_after_save)
{
LLLiveLSLEditor* self = (LLLiveLSLEditor*)userdata;
// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a
/*
if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.isLockedAttachment(gObjectList.findObject(self->mObjectID), RLV_LOCK_REMOVE)) )
// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.5a
const LLViewerObject* pObject = gObjectList.findObject(self->mObjectUUID);
if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.isLockedAttachment(pObject->getRootEdit())) )
{
return;
}
*/
// [/RLVa:KB]
self->mCloseAfterSave = close_after_save;