From 4eba3373dcbb564186f6051daa1c77153123ad51 Mon Sep 17 00:00:00 2001 From: MW Date: Mon, 3 Dec 2007 14:37:20 +0000 Subject: Fixed bug in Appearance update in AvatarFactoryModule. --- .../Environment/Modules/AvatarFactoryModule.cs | 33 ++++++++++++---------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs index 3e685a5..edaad82 100644 --- a/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs +++ b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs @@ -77,27 +77,30 @@ namespace OpenSim.Region.Environment.Modules CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(clientView.AgentId); if (profile != null) { - //Todo look up the assetid from the inventory cache (or something) for each itemId that is in AvatarWearingArgs - // then store assetid and itemId and wearable type in a database - foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) + if (profile.RootFolder != null) { - if (wear.Type < 13) + //Todo look up the assetid from the inventory cache (or something) for each itemId that is in AvatarWearingArgs + // then store assetid and itemId and wearable type in a database + foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) { - LLUUID assetId; - - InventoryItemBase baseItem = profile.RootFolder.HasItem(wear.ItemID); - if (baseItem != null) + if (wear.Type < 13) { - assetId = baseItem.assetID; - //temporary dictionary storage. This should be storing to a database - if (m_avatarsClothes.ContainsKey(clientView.AgentId)) + LLUUID assetId; + + InventoryItemBase baseItem = profile.RootFolder.HasItem(wear.ItemID); + if (baseItem != null) { - AvatarAppearance avWearing = m_avatarsClothes[clientView.AgentId]; - avWearing.IsWearing[wear.Type].AssetID = assetId; - avWearing.IsWearing[wear.Type].ItemID = wear.ItemID; + assetId = baseItem.assetID; + //temporary dictionary storage. This should be storing to a database + if (m_avatarsClothes.ContainsKey(clientView.AgentId)) + { + AvatarAppearance avWearing = m_avatarsClothes[clientView.AgentId]; + avWearing.IsWearing[wear.Type].AssetID = assetId; + avWearing.IsWearing[wear.Type].ItemID = wear.ItemID; + } } - } + } } } } -- cgit v1.1