Update RLVLocks

This commit is contained in:
Lirusaito
2016-05-26 13:10:27 -04:00
parent cfea4f4ccf
commit fb9101598a
2 changed files with 35 additions and 31 deletions

View File

@@ -17,7 +17,6 @@
#ifndef RLV_LOCKS_H
#define RLV_LOCKS_H
#include "llagentconstants.h"
#include "llagentwearables.h"
#include "lleventtimer.h"
#include "llvoavatarself.h"
@@ -123,7 +122,8 @@ public:
typedef std::multimap<S32, LLUUID> rlv_attachptlock_map_t;
// Accessors for RlvFloaterLocks
const rlv_attachptlock_map_t& getAttachPtLocks(ERlvLockMask eLock) { return (RLV_LOCK_ADD == eLock) ? m_AttachPtAdd : m_AttachPtRem; }
const rlv_attachobjlock_map_t& getAttachObjLocks() { return m_AttachObjRem; }
const rlv_attachobjlock_map_t& getAttachObjLocks() const
{ return m_AttachObjRem; }
private:
rlv_attachptlock_map_t m_AttachPtAdd; // Map of attachment points that can't be attached to (idxAttachPt -> idObj)
rlv_attachptlock_map_t m_AttachPtRem; // Map of attachment points whose attachments can't be detached (idxAttachPt -> idObj)
@@ -202,8 +202,8 @@ protected:
ERlvWearMask eWearAction;
F64 tsWear;
std::map<S32, uuid_vec_t> attachPts;
protected:
RlvWearInfo();
//protected:
//RlvWearInfo(); // not implemented
};
typedef std::map<LLUUID, RlvWearInfo> rlv_wear_map_t;
rlv_wear_map_t m_PendingWear;
@@ -355,7 +355,7 @@ public:
protected:
bool getLockedFolders(const folderlock_source_t& lockSource, LLInventoryModel::cat_array_t& lockFolders) const;
bool getLockedItems(const LLUUID& idFolder, LLInventoryModel::item_array_t& lockItems) const;
void onNeedsLookupRefresh();
void onNeedsLookupRefresh() const;
void refreshLockedLookups() const;
/*
@@ -364,9 +364,12 @@ protected:
public:
typedef std::list<const folderlock_descr_t*> folderlock_list_t;
// Accessors for RlvFloaterLocks
const folderlock_list_t& getFolderLocks() { return m_FolderLocks; }
const uuid_vec_t& getAttachmentLookups() { return m_LockedAttachmentRem; }
const uuid_vec_t& getWearableLookups() { return m_LockedWearableRem; }
const folderlock_list_t& getFolderLocks() const
{ return m_FolderLocks; }
const uuid_vec_t& getAttachmentLookups() const
{ return m_LockedAttachmentRem; }
const uuid_vec_t& getWearableLookups() const
{ return m_LockedWearableRem; }
protected:
// Map of folder locks (idRlvObj -> lockDescr)
folderlock_list_t m_FolderLocks; // List of add and remove locked folder descriptions
@@ -391,19 +394,19 @@ private:
// Checked: 2010-11-30 (RLVa-1.4.0b) | Added: RLVa-1.4.0b
inline LLViewerJointAttachment* RlvAttachPtLookup::getAttachPoint(S32 idxAttachPt)
{
return (isAgentAvatarValid()) ? get_if_there(gAgentAvatarp->mAttachmentPoints, idxAttachPt, (LLViewerJointAttachment*)NULL) : NULL;
return (isAgentAvatarValid()) ? get_if_there(gAgentAvatarp->mAttachmentPoints, idxAttachPt, static_cast<LLViewerJointAttachment*>(NULL)) : NULL;
}
// Checked: 2010-03-03 (RLVa-1.2.0a) | Modified: RLVa-0.2.0d
inline LLViewerJointAttachment* RlvAttachPtLookup::getAttachPoint(const std::string& strText)
{
return (isAgentAvatarValid()) ? get_if_there(gAgentAvatarp->mAttachmentPoints, getAttachPointIndex(strText), (LLViewerJointAttachment*)NULL) : NULL;
return (isAgentAvatarValid()) ? get_if_there(gAgentAvatarp->mAttachmentPoints, getAttachPointIndex(strText), static_cast<LLViewerJointAttachment*>(NULL)) : NULL;
}
// Checked: 2010-03-03 (RLVa-1.2.0a) | Modified: RLVa-1.0.1b
inline LLViewerJointAttachment* RlvAttachPtLookup::getAttachPoint(const LLInventoryItem* pItem)
{
return (isAgentAvatarValid()) ? get_if_there(gAgentAvatarp->mAttachmentPoints, getAttachPointIndex(pItem), (LLViewerJointAttachment*)NULL) : NULL;
return (isAgentAvatarValid()) ? get_if_there(gAgentAvatarp->mAttachmentPoints, getAttachPointIndex(pItem), static_cast<LLViewerJointAttachment*>(NULL)) : NULL;
}
// Checked: 2010-03-03 (RLVa-1.2.0a) | Modified: RLVa-1.2.0a
@@ -447,12 +450,12 @@ inline ERlvWearMask RlvAttachmentLocks::canAttach(const LLViewerJointAttachment*
// Empty attachment point => RLV_WEAR_ADD | RLV_WEAR_REPLACE
RLV_ASSERT(pAttachPt); // TODO-RLVa: [RLVa-1.2.1] Maybe it's better to just return something similar like above?
return
(ERlvWearMask)(((pAttachPt) && (!isLockedAttachmentPoint(pAttachPt, RLV_LOCK_ADD)))
static_cast<ERlvWearMask>(((pAttachPt) && (!isLockedAttachmentPoint(pAttachPt, RLV_LOCK_ADD)))
? ((canDetach(pAttachPt, true)) ? RLV_WEAR_REPLACE : 0) | RLV_WEAR_ADD
: RLV_WEAR_LOCKED);
}
// Checked: 2010-02-28 (RLVa-1.2.0a) | Added: RLVa-1.0.5a
// Checked: 2010-02-28 (RLVa-1.2.0)
inline bool RlvAttachmentLocks::canDetach(const LLInventoryItem* pItem) const
{
const LLViewerObject* pAttachObj =
@@ -476,6 +479,7 @@ inline bool RlvAttachmentLocks::isLockedAttachment(const LLViewerObject* pAttach
RLV_ASSERT( (!pAttachObj) || (pAttachObj == pAttachObj->getRootEdit()) );
// Object is locked if:
// - it's not a temporary attachment
// - it's specifically marked as non-detachable (ie @detach=n)
// - it's attached to an attachment point that is RLV_LOCK_REMOVE locked (ie @remattach:<attachpt>=n)
// - it's part of a locked folder