Remove "add" inventory operation and rename MAX_WEARABLES_PER_TYPE
This patch removes the invalid "add" operation shown on wearables in inventory It also renames MAX_WEARABLES_PER_TYPE, resets the value to 1 (non-multi-wearables), and adds a weak check to enforce one wearable per type. Code reviewed by Virmeow-7.2.2
parent
42767687ef
commit
404ed736ec
|
|
@ -655,20 +655,20 @@ U32 LLAgentWearables::pushWearable(const EWearableType type, LLWearable *wearabl
|
|||
{
|
||||
// no null wearables please!
|
||||
//TODO: insert llwarns
|
||||
return MAX_ATTACHMENTS_PER_TYPE;
|
||||
return MAX_WEARABLES_PER_TYPE;
|
||||
}
|
||||
if (type < WT_COUNT)
|
||||
if (type < WT_COUNT || mWearableDatas[type].size() < MAX_WEARABLES_PER_TYPE)
|
||||
{
|
||||
mWearableDatas[type].push_back(wearable);
|
||||
return mWearableDatas[type].size()-1;
|
||||
}
|
||||
return MAX_ATTACHMENTS_PER_TYPE;
|
||||
return MAX_WEARABLES_PER_TYPE;
|
||||
}
|
||||
|
||||
void LLAgentWearables::popWearable(const EWearableType type, LLWearable *wearable)
|
||||
{
|
||||
U32 index = getWearableIndex(type, wearable);
|
||||
if (index < MAX_ATTACHMENTS_PER_TYPE && index < getWearableCount(type))
|
||||
if (index < MAX_WEARABLES_PER_TYPE && index < getWearableCount(type))
|
||||
{
|
||||
popWearable(type, index);
|
||||
}
|
||||
|
|
@ -688,7 +688,7 @@ U32 LLAgentWearables::getWearableIndex(const EWearableType type, LLWearable *wea
|
|||
if (wearable_iter == mWearableDatas.end())
|
||||
{
|
||||
llwarns << "tried to get wearable index with an invalid type!" << llendl;
|
||||
return MAX_ATTACHMENTS_PER_TYPE;
|
||||
return MAX_WEARABLES_PER_TYPE;
|
||||
}
|
||||
const wearableentry_vec_t& wearable_vec = wearable_iter->second;
|
||||
for(U32 index = 0; index < wearable_vec.size(); index++)
|
||||
|
|
@ -699,7 +699,7 @@ U32 LLAgentWearables::getWearableIndex(const EWearableType type, LLWearable *wea
|
|||
}
|
||||
}
|
||||
|
||||
return MAX_ATTACHMENTS_PER_TYPE;
|
||||
return MAX_WEARABLES_PER_TYPE;
|
||||
}
|
||||
|
||||
const LLWearable* LLAgentWearables::getWearable(const EWearableType type, U32 index) const
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ private:
|
|||
LLPointer<LLRefCount> mCB;
|
||||
};
|
||||
|
||||
static const U32 MAX_ATTACHMENTS_PER_TYPE = 4;
|
||||
static const U32 MAX_WEARABLES_PER_TYPE = 1;
|
||||
|
||||
}; // LLAgentWearables
|
||||
|
||||
|
|
|
|||
|
|
@ -603,14 +603,6 @@
|
|||
function="Inventory.DoToSelected"
|
||||
parameter="wear" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Add"
|
||||
layout="topleft"
|
||||
name="Wearable Add">
|
||||
<menu_item_call.on_click
|
||||
function="Inventory.DoToSelected"
|
||||
parameter="wear_add" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Take Off"
|
||||
layout="topleft"
|
||||
|
|
|
|||
Loading…
Reference in New Issue