aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
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
parentComment out Scene.CleanDroppedAttachments() and calls. (diff)
downloadopensim-SC-5c1fa968ab954bec9860023dffc8f68baf3c0620.zip
opensim-SC-5c1fa968ab954bec9860023dffc8f68baf3c0620.tar.gz
opensim-SC-5c1fa968ab954bec9860023dffc8f68baf3c0620.tar.bz2
opensim-SC-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')
-rw-r--r--OpenSim/Framework/AvatarAppearance.cs15
-rw-r--r--OpenSim/Framework/AvatarAttachment.cs2
2 files changed, 14 insertions, 3 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)
diff --git a/OpenSim/Framework/AvatarAttachment.cs b/OpenSim/Framework/AvatarAttachment.cs
index c68d78d..07dd385 100644
--- a/OpenSim/Framework/AvatarAttachment.cs
+++ b/OpenSim/Framework/AvatarAttachment.cs
@@ -66,11 +66,11 @@ namespace OpenSim.Framework
66 return attachdata; 66 return attachdata;
67 } 67 }
68 68
69
70 public void Unpack(OSDMap args) 69 public void Unpack(OSDMap args)
71 { 70 {
72 if (args["point"] != null) 71 if (args["point"] != null)
73 AttachPoint = args["point"].AsInteger(); 72 AttachPoint = args["point"].AsInteger();
73
74 ItemID = (args["item"] != null) ? args["item"].AsUUID() : UUID.Zero; 74 ItemID = (args["item"] != null) ? args["item"].AsUUID() : UUID.Zero;
75 AssetID = (args["asset"] != null) ? args["asset"].AsUUID() : UUID.Zero; 75 AssetID = (args["asset"] != null) ? args["asset"].AsUUID() : UUID.Zero;
76 } 76 }