[FIXED] Holding the @setenv restriction isn't preventing other objects from changing the environment settings
parent
c326edb942
commit
43bd5d8303
|
|
@ -366,9 +366,11 @@ bool RlvActions::isLocalTp(const LLVector3d& posGlobal)
|
|||
// WindLight
|
||||
//
|
||||
|
||||
bool RlvActions::canChangeEnvironment()
|
||||
bool RlvActions::canChangeEnvironment(const LLUUID& idRlvObject)
|
||||
{
|
||||
return !gRlvHandler.hasBehaviour(RLV_BHVR_SETENV);
|
||||
// User can (partially) change their environment settings if:
|
||||
// - not specifically restricted from changing their environment (by any object other than the one specified)
|
||||
return (idRlvObject.isNull()) ? !gRlvHandler.hasBehaviour(RLV_BHVR_SETENV) : !gRlvHandler.hasBehaviourExcept(RLV_BHVR_SETENV, idRlvObject);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
|
|
|||
|
|
@ -218,9 +218,9 @@ public:
|
|||
// =========
|
||||
public:
|
||||
/*
|
||||
* Returns true if the user can make changes to their WindLight environment
|
||||
* Returns true if the user can make changes to their WindLight environment
|
||||
*/
|
||||
static bool canChangeEnvironment();
|
||||
static bool canChangeEnvironment(const LLUUID& idRlvObject = LLUUID::null);
|
||||
|
||||
|
||||
// =================
|
||||
|
|
|
|||
|
|
@ -502,6 +502,12 @@ bool RlvEnvironment::onHandleCommand(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRe
|
|||
{
|
||||
if ( (rlvCmd.getBehaviour().length() > strCmdPrefix.length() + 2) && (boost::starts_with(rlvCmd.getBehaviour(), strCmdPrefix)) )
|
||||
{
|
||||
if ( (RLV_TYPE_FORCE == rlvCmd.getParamType()) && (!RlvActions::canChangeEnvironment(rlvCmd.getObjectID())) )
|
||||
{
|
||||
cmdRet = RLV_RET_FAILED_LOCK;
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string strEnvCommand = rlvCmd.getBehaviour().substr(strCmdPrefix.length());
|
||||
|
||||
handler_map_t::const_iterator itFnEntry = fnLookup.find(strEnvCommand);
|
||||
|
|
|
|||
Loading…
Reference in New Issue