Scare everyone with a big-arsed warning. Horray!
This commit is contained in:
@@ -7733,7 +7733,8 @@ void LLAgent::sendAgentSetAppearance()
|
||||
}
|
||||
|
||||
|
||||
const bool wearing_physics = !!getWearable(WT_PHYSICS);
|
||||
static bool send_physics_params = false;
|
||||
send_physics_params |= !!getWearable(WT_PHYSICS);
|
||||
S32 transmitted_params = 0;
|
||||
for (LLViewerVisualParam* param = (LLViewerVisualParam*)mAvatarObject->getFirstVisualParam();
|
||||
param;
|
||||
@@ -7741,17 +7742,17 @@ void LLAgent::sendAgentSetAppearance()
|
||||
{
|
||||
if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) // do not transmit params of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT
|
||||
{
|
||||
msg->nextBlockFast(_PREHASH_VisualParam );
|
||||
|
||||
// We don't send the param ids. Instead, we assume that the receiver has the same params in the same sequence.
|
||||
const F32 param_value = param->getWeight();
|
||||
const U8 new_weight = F32_to_U8(param_value, param->getMinWeight(), param->getMaxWeight());
|
||||
msg->addU8Fast(_PREHASH_ParamValue, new_weight );
|
||||
//A hack to prevent ruthing on older viewers when phys wearables aren't being worn.
|
||||
if(!wearing_physics && param->getID() >= 10000)
|
||||
if(!send_physics_params && param->getID() >= 10000)
|
||||
{
|
||||
break;
|
||||
}
|
||||
msg->nextBlockFast(_PREHASH_VisualParam );
|
||||
// We don't send the param ids. Instead, we assume that the receiver has the same params in the same sequence.
|
||||
const F32 param_value = param->getWeight();
|
||||
const U8 new_weight = F32_to_U8(param_value, param->getMinWeight(), param->getMaxWeight());
|
||||
|
||||
msg->addU8Fast(_PREHASH_ParamValue, new_weight );
|
||||
transmitted_params++;
|
||||
}
|
||||
}
|
||||
@@ -7892,6 +7893,30 @@ struct LLSetWearableData
|
||||
LLWearable* mNewWearable;
|
||||
};
|
||||
|
||||
static bool isFirstPhysicsWearable(EWearableType type, LLInventoryItem *new_item, LLWearable *new_wearable)
|
||||
{
|
||||
if (type == WT_PHYSICS && gSavedSettings.getWarning("FirstPhysicsWearable"))
|
||||
{
|
||||
class WearableDelayedCallback
|
||||
{
|
||||
public:
|
||||
static void setDelayedWearable( const LLSD& notification, const LLSD& response, LLUUID item_id, LLWearable *wearable )
|
||||
{
|
||||
if(LLNotification::getSelectedOption(notification, response) == 0) //User selected wear
|
||||
{
|
||||
gSavedSettings.setWarning("FirstPhysicsWearable",FALSE);
|
||||
LLInventoryItem *item = gInventory.getItem(item_id);
|
||||
if(item)
|
||||
gAgent.setWearable(item,wearable); //re-enter.
|
||||
}
|
||||
}
|
||||
};
|
||||
LLNotifications::instance().add("FirstPhysicsWearable",LLSD(),LLSD(),boost::bind(WearableDelayedCallback::setDelayedWearable, _1, _2, new_item->getUUID(),new_wearable));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
BOOL LLAgent::needsReplacement(EWearableType wearableType, S32 remove)
|
||||
{
|
||||
return TRUE;
|
||||
@@ -7961,6 +7986,11 @@ void LLAgent::setWearableOutfit(
|
||||
}
|
||||
}
|
||||
|
||||
if (isFirstPhysicsWearable(type, new_item, new_wearable))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
mWearableEntry[ type ].mItemID = new_item->getUUID();
|
||||
mWearableEntry[ type ].mWearable = new_wearable;
|
||||
}
|
||||
@@ -8025,6 +8055,11 @@ void LLAgent::setWearable( LLInventoryItem* new_item, LLWearable* new_wearable )
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
|
||||
if (isFirstPhysicsWearable(type, new_item, new_wearable))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if( old_wearable )
|
||||
{
|
||||
const LLUUID& old_item_id = mWearableEntry[ type ].mItemID;
|
||||
|
||||
Reference in New Issue
Block a user