aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/AvatarAppearance.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-09-03 01:11:16 +0100
committerJustin Clark-Casey (justincc)2011-09-03 01:11:16 +0100
commit5c1fa968ab954bec9860023dffc8f68baf3c0620 (patch)
treef5be7264076e9e2815cd05f6a7ba8bac2831330a /OpenSim/Framework/AvatarAppearance.cs
parentComment out Scene.CleanDroppedAttachments() and calls. (diff)
downloadopensim-SC_OLD-5c1fa968ab954bec9860023dffc8f68baf3c0620.zip
opensim-SC_OLD-5c1fa968ab954bec9860023dffc8f68baf3c0620.tar.gz
opensim-SC_OLD-5c1fa968ab954bec9860023dffc8f68baf3c0620.tar.bz2
opensim-SC_OLD-5c1fa968ab954bec9860023dffc8f68baf3c0620.tar.xz
Stop NPCs losing attachments when the source avatar takes them off.
This was happening because we were using the source avatar's item IDs in the clone appearance. Switch to using the asset IDs of attachments instead for NPCs. The InventoryAccessModule and AttachmentModule had to be changed to allow rezzing of an object without an associated inventory item. Hopefully goes some way towards resolving http://opensimulator.org/mantis/view.php?id=5653
Diffstat (limited to 'OpenSim/Framework/AvatarAppearance.cs')
-rw-r--r--OpenSim/Framework/AvatarAppearance.cs15
1 files changed, 13 insertions, 2 deletions
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs
index 7c6295d..aed9087 100644
--- a/OpenSim/Framework/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -433,6 +433,10 @@ namespace OpenSim.Framework
433 if (attachpoint == 0) 433 if (attachpoint == 0)
434 return false; 434 return false;
435 435
436// m_log.DebugFormat(
437// "[AVATAR APPEARANCE]: Setting attachment at {0} with item ID {1}, asset ID {2}",
438// attachpoint, item, asset);
439
436 if (item == UUID.Zero) 440 if (item == UUID.Zero)
437 { 441 {
438 if (m_attachments.ContainsKey(attachpoint)) 442 if (m_attachments.ContainsKey(attachpoint))
@@ -459,7 +463,7 @@ namespace OpenSim.Framework
459 } 463 }
460 else 464 else
461 { 465 {
462 ReplaceAttachment(new AvatarAttachment(attachpoint,item,asset)); 466 ReplaceAttachment(new AvatarAttachment(attachpoint,item, asset));
463 } 467 }
464 return true; 468 return true;
465 } 469 }
@@ -608,7 +612,14 @@ namespace OpenSim.Framework
608 { 612 {
609 OSDArray attachs = (OSDArray)(data["attachments"]); 613 OSDArray attachs = (OSDArray)(data["attachments"]);
610 for (int i = 0; i < attachs.Count; i++) 614 for (int i = 0; i < attachs.Count; i++)
611 AppendAttachment(new AvatarAttachment((OSDMap)attachs[i])); 615 {
616 AvatarAttachment att = new AvatarAttachment((OSDMap)attachs[i]);
617 AppendAttachment(att);
618
619// m_log.DebugFormat(
620// "[AVATAR APPEARANCE]: Unpacked attachment itemID {0}, assetID {1}, point {2}",
621// att.ItemID, att.AssetID, att.AttachPoint);
622 }
612 } 623 }
613 } 624 }
614 catch (Exception e) 625 catch (Exception e)