diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 21 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | 15 |
2 files changed, 20 insertions, 16 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 14f923d..d7458b7 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -3387,20 +3387,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3387 | aw.AgentData.SerialNum = (uint)serial; | 3387 | aw.AgentData.SerialNum = (uint)serial; |
3388 | aw.AgentData.SessionID = m_sessionId; | 3388 | aw.AgentData.SessionID = m_sessionId; |
3389 | 3389 | ||
3390 | int count = 0; | ||
3391 | for (int i = 0; i < wearables.Length; i++) | ||
3392 | count += wearables[i].Count; | ||
3393 | |||
3390 | // TODO: don't create new blocks if recycling an old packet | 3394 | // TODO: don't create new blocks if recycling an old packet |
3391 | aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[13]; | 3395 | aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[count]; |
3392 | AgentWearablesUpdatePacket.WearableDataBlock awb; | 3396 | AgentWearablesUpdatePacket.WearableDataBlock awb; |
3397 | int idx = 0; | ||
3393 | for (int i = 0; i < wearables.Length; i++) | 3398 | for (int i = 0; i < wearables.Length; i++) |
3394 | { | 3399 | { |
3395 | awb = new AgentWearablesUpdatePacket.WearableDataBlock(); | 3400 | for (int j = 0; j < wearables[i].Count; j++) |
3396 | awb.WearableType = (byte)i; | 3401 | { |
3397 | awb.AssetID = wearables[i].AssetID; | 3402 | awb = new AgentWearablesUpdatePacket.WearableDataBlock(); |
3398 | awb.ItemID = wearables[i].ItemID; | 3403 | awb.WearableType = (byte)i; |
3399 | aw.WearableData[i] = awb; | 3404 | awb.AssetID = wearables[i][j].AssetID; |
3405 | awb.ItemID = wearables[i][j].ItemID; | ||
3406 | aw.WearableData[idx] = awb; | ||
3407 | idx++; | ||
3400 | 3408 | ||
3401 | // m_log.DebugFormat( | 3409 | // m_log.DebugFormat( |
3402 | // "[APPEARANCE]: Sending wearable item/asset {0} {1} (index {2}) for {3}", | 3410 | // "[APPEARANCE]: Sending wearable item/asset {0} {1} (index {2}) for {3}", |
3403 | // awb.ItemID, awb.AssetID, i, Name); | 3411 | // awb.ItemID, awb.AssetID, i, Name); |
3412 | } | ||
3404 | } | 3413 | } |
3405 | 3414 | ||
3406 | OutPacket(aw, ThrottleOutPacketType.Task); | 3415 | OutPacket(aw, ThrottleOutPacketType.Task); |
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index bfbbcf8..4d27ea4 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -393,27 +393,22 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
393 | { | 393 | { |
394 | for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++) | 394 | for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++) |
395 | { | 395 | { |
396 | if (appearance.Wearables[i].ItemID == UUID.Zero) | 396 | for (int j = 0 ; j < appearance.Wearables[j].Count ; j ++ ) |
397 | { | 397 | { |
398 | appearance.Wearables[i].AssetID = UUID.Zero; | 398 | InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i][j].ItemID, userID); |
399 | } | ||
400 | else | ||
401 | { | ||
402 | InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i].ItemID, userID); | ||
403 | baseItem = invService.GetItem(baseItem); | 399 | baseItem = invService.GetItem(baseItem); |
404 | 400 | ||
405 | if (baseItem != null) | 401 | if (baseItem != null) |
406 | { | 402 | { |
407 | appearance.Wearables[i].AssetID = baseItem.AssetID; | 403 | appearance.Wearables[i].Add(appearance.Wearables[i][j].ItemID, baseItem.AssetID); |
408 | } | 404 | } |
409 | else | 405 | else |
410 | { | 406 | { |
411 | m_log.ErrorFormat( | 407 | m_log.ErrorFormat( |
412 | "[AVFACTORY]: Can't find inventory item {0} for {1}, setting to default", | 408 | "[AVFACTORY]: Can't find inventory item {0} for {1}, setting to default", |
413 | appearance.Wearables[i].ItemID, (WearableType)i); | 409 | appearance.Wearables[i][j].ItemID, (WearableType)i); |
414 | 410 | ||
415 | appearance.Wearables[i].ItemID = UUID.Zero; | 411 | appearance.Wearables[i].RemoveItem(appearance.Wearables[i][j].ItemID); |
416 | appearance.Wearables[i].AssetID = UUID.Zero; | ||
417 | } | 412 | } |
418 | } | 413 | } |
419 | } | 414 | } |