aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs36
1 files changed, 5 insertions, 31 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index acd156e..951afd7 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -286,20 +286,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
286 286
287 public bool AttachObject(IScenePresence sp, SceneObjectGroup group, uint attachmentPt, bool silent, bool useAttachData, bool temp) 287 public bool AttachObject(IScenePresence sp, SceneObjectGroup group, uint attachmentPt, bool silent, bool useAttachData, bool temp)
288 { 288 {
289 if (!Enabled)
290 return false;
291
292 if (AttachObjectInternal(sp, group, attachmentPt, silent, useAttachData, temp))
293 {
294 m_scene.EventManager.TriggerOnAttach(group.LocalId, group.FromItemID, sp.UUID);
295 return true;
296 }
297
298 return false;
299 }
300
301 private bool AttachObjectInternal(IScenePresence sp, SceneObjectGroup group, uint attachmentPt, bool silent, bool useAttachData, bool temp)
302 {
303 lock (sp.AttachmentsSyncLock) 289 lock (sp.AttachmentsSyncLock)
304 { 290 {
305// m_log.DebugFormat( 291// m_log.DebugFormat(
@@ -475,11 +461,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
475 461
476 public void DetachSingleAttachmentToGround(IScenePresence sp, uint soLocalId) 462 public void DetachSingleAttachmentToGround(IScenePresence sp, uint soLocalId)
477 { 463 {
478 DetachSingleAttachmentToGround(sp, soLocalId, sp.AbsolutePosition, Quaternion.Identity);
479 }
480
481 public void DetachSingleAttachmentToGround(IScenePresence sp, uint soLocalId, Vector3 absolutePos, Quaternion absoluteRot)
482 {
483 if (!Enabled) 464 if (!Enabled)
484 return; 465 return;
485 466
@@ -521,11 +502,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
521 so.FromItemID = UUID.Zero; 502 so.FromItemID = UUID.Zero;
522 503
523 SceneObjectPart rootPart = so.RootPart; 504 SceneObjectPart rootPart = so.RootPart;
524 so.AbsolutePosition = absolutePos; 505 so.AbsolutePosition = sp.AbsolutePosition;
525 if (absoluteRot != Quaternion.Identity)
526 {
527 so.UpdateGroupRotationR(absoluteRot);
528 }
529 so.AttachedAvatar = UUID.Zero; 506 so.AttachedAvatar = UUID.Zero;
530 rootPart.SetParentLocalId(0); 507 rootPart.SetParentLocalId(0);
531 so.ClearPartAttachmentData(); 508 so.ClearPartAttachmentData();
@@ -639,9 +616,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
639 616
640 if (grp.HasGroupChanged) 617 if (grp.HasGroupChanged)
641 { 618 {
642 m_log.DebugFormat( 619// m_log.DebugFormat(
643 "[ATTACHMENTS MODULE]: Updating asset for attachment {0}, attachpoint {1}", 620// "[ATTACHMENTS MODULE]: Updating asset for attachment {0}, attachpoint {1}",
644 grp.UUID, grp.AttachmentPoint); 621// grp.UUID, grp.AttachmentPoint);
645 622
646 string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp, scriptedState); 623 string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp, scriptedState);
647 624
@@ -885,7 +862,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
885 // This will throw if the attachment fails 862 // This will throw if the attachment fails
886 try 863 try
887 { 864 {
888 AttachObjectInternal(sp, objatt, attachmentPt, false, false, false); 865 AttachObject(sp, objatt, attachmentPt, false, false, false);
889 } 866 }
890 catch (Exception e) 867 catch (Exception e)
891 { 868 {
@@ -956,9 +933,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
956 933
957 InventoryItemBase item = new InventoryItemBase(itemID, sp.UUID); 934 InventoryItemBase item = new InventoryItemBase(itemID, sp.UUID);
958 item = m_scene.InventoryService.GetItem(item); 935 item = m_scene.InventoryService.GetItem(item);
959 if (item == null)
960 return;
961
962 bool changed = sp.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID); 936 bool changed = sp.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID);
963 if (changed && m_scene.AvatarFactory != null) 937 if (changed && m_scene.AvatarFactory != null)
964 { 938 {