From e98d8d500f5c0dda6e9ef8b9a0e1bddec8510d1d Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 30 Oct 2010 19:06:47 +0100 Subject: Fix logins and avatar appearance. Contains a Migration. May contain nuts. This will cause visual params to be persisted along with worn items. With this, alpha and tattoo laters will be saved. Multiple layers MAY work, but not tested because I don't use Viewer 2. --- .../Avatar/AvatarFactory/AvatarFactoryModule.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/CoreModules/Avatar/AvatarFactory') diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 6cbd8bd..7f482cb 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -356,17 +356,16 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory // m_log.WarnFormat("[AVATAR FACTORY MODULE]: AvatarIsWearing called for {0}",client.AgentId); - AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance); + AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance, false); foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) { if (wear.Type < AvatarWearable.MAX_WEARABLES) - { - AvatarWearable newWearable = new AvatarWearable(wear.ItemID,UUID.Zero); - avatAppearance.SetWearable(wear.Type, newWearable); - } + avatAppearance.Wearables[wear.Type].Add(wear.ItemID,UUID.Zero); } + avatAppearance.GetAssetsFrom(sp.Appearance); + // This could take awhile since it needs to pull inventory SetAppearanceAssets(sp.UUID, ref avatAppearance); @@ -384,6 +383,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory { for (int j = 0 ; j < appearance.Wearables[j].Count ; j ++ ) { + if (appearance.Wearables[i][j].ItemID == UUID.Zero) + continue; + + // Ignore ruth's assets + if (appearance.Wearables[i][j].ItemID == AvatarWearable.DefaultWearables[i][0].ItemID) + continue; InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i][j].ItemID, userID); baseItem = invService.GetItem(baseItem); -- cgit v1.1