mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 11:33:28 +08:00
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
This commit is contained in:
@@ -3387,20 +3387,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
aw.AgentData.SerialNum = (uint)serial;
|
||||
aw.AgentData.SessionID = m_sessionId;
|
||||
|
||||
int count = 0;
|
||||
for (int i = 0; i < wearables.Length; i++)
|
||||
count += wearables[i].Count;
|
||||
|
||||
// TODO: don't create new blocks if recycling an old packet
|
||||
aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[13];
|
||||
aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[count];
|
||||
AgentWearablesUpdatePacket.WearableDataBlock awb;
|
||||
int idx = 0;
|
||||
for (int i = 0; i < wearables.Length; i++)
|
||||
{
|
||||
awb = new AgentWearablesUpdatePacket.WearableDataBlock();
|
||||
awb.WearableType = (byte)i;
|
||||
awb.AssetID = wearables[i].AssetID;
|
||||
awb.ItemID = wearables[i].ItemID;
|
||||
aw.WearableData[i] = awb;
|
||||
for (int j = 0; j < wearables[i].Count; j++)
|
||||
{
|
||||
awb = new AgentWearablesUpdatePacket.WearableDataBlock();
|
||||
awb.WearableType = (byte)i;
|
||||
awb.AssetID = wearables[i][j].AssetID;
|
||||
awb.ItemID = wearables[i][j].ItemID;
|
||||
aw.WearableData[idx] = awb;
|
||||
idx++;
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[APPEARANCE]: Sending wearable item/asset {0} {1} (index {2}) for {3}",
|
||||
// awb.ItemID, awb.AssetID, i, Name);
|
||||
}
|
||||
}
|
||||
|
||||
OutPacket(aw, ThrottleOutPacketType.Task);
|
||||
|
||||
@@ -382,27 +382,22 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
{
|
||||
for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
|
||||
{
|
||||
if (appearance.Wearables[i].ItemID == UUID.Zero)
|
||||
for (int j = 0 ; j < appearance.Wearables[j].Count ; j ++ )
|
||||
{
|
||||
appearance.Wearables[i].AssetID = UUID.Zero;
|
||||
}
|
||||
else
|
||||
{
|
||||
InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i].ItemID, userID);
|
||||
InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i][j].ItemID, userID);
|
||||
baseItem = invService.GetItem(baseItem);
|
||||
|
||||
if (baseItem != null)
|
||||
{
|
||||
appearance.Wearables[i].AssetID = baseItem.AssetID;
|
||||
appearance.Wearables[i].Add(appearance.Wearables[i][j].ItemID, baseItem.AssetID);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[AVATAR FACTORY MODULE]: Can't find inventory item {0} for {1}, setting to default",
|
||||
appearance.Wearables[i].ItemID, (WearableType)i);
|
||||
appearance.Wearables[i][j].ItemID, (WearableType)i);
|
||||
|
||||
appearance.Wearables[i].ItemID = UUID.Zero;
|
||||
appearance.Wearables[i].AssetID = UUID.Zero;
|
||||
appearance.Wearables[i].RemoveItem(appearance.Wearables[i][j].ItemID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user