Skip to content
Snippets Groups Projects
Commit 404ed736 authored by Neal Orman's avatar Neal Orman
Browse files

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 Vir
parent 42767687
No related branches found
No related tags found
No related merge requests found
......@@ -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 @@ class LLAgentWearables
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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment