From 0cb0140a1d652c3ba47f1c9000d1ba81c8e786f8 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 6 Sep 2011 00:29:37 +0100 Subject: Stop the pointless double setting of every attachment in AvatarAppearance. The second was already being filtered out so this has no user level effect --- OpenSim/Framework/AvatarAppearance.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'OpenSim/Framework/AvatarAppearance.cs') diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index aed9087..0b0afeb 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs @@ -402,8 +402,13 @@ namespace OpenSim.Framework internal void AppendAttachment(AvatarAttachment attach) { - if (! m_attachments.ContainsKey(attach.AttachPoint)) +// m_log.DebugFormat( +// "[AVATAR APPEARNCE]: Appending itemID={0}, assetID={1} at {2}", +// attach.ItemID, attach.AssetID, attach.AttachPoint); + + if (!m_attachments.ContainsKey(attach.AttachPoint)) m_attachments[attach.AttachPoint] = new List(); + m_attachments[attach.AttachPoint].Add(attach); } @@ -430,13 +435,13 @@ namespace OpenSim.Framework /// public bool SetAttachment(int attachpoint, UUID item, UUID asset) { - if (attachpoint == 0) - return false; - // m_log.DebugFormat( // "[AVATAR APPEARANCE]: Setting attachment at {0} with item ID {1}, asset ID {2}", // attachpoint, item, asset); + if (attachpoint == 0) + return false; + if (item == UUID.Zero) { if (m_attachments.ContainsKey(attachpoint)) @@ -465,6 +470,7 @@ namespace OpenSim.Framework { ReplaceAttachment(new AvatarAttachment(attachpoint,item, asset)); } + return true; } -- cgit v1.1