aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
diff options
context:
space:
mode:
authorMelanie2013-03-29 02:15:47 +0000
committerMelanie2013-03-29 02:15:47 +0000
commit05810e48b013f4ca67beae68b2b7fb8030bd9c3b (patch)
tree1df064176b61b95d18dd6d8faf46676f6f684162 /OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
parentMerge commit '2b142f2f9e888d5cb7317cc51c12ac7152c54459' into careminster (diff)
parentStop attempts to update/add existing attachments in user inventory when telep... (diff)
downloadopensim-SC-05810e48b013f4ca67beae68b2b7fb8030bd9c3b.zip
opensim-SC-05810e48b013f4ca67beae68b2b7fb8030bd9c3b.tar.gz
opensim-SC-05810e48b013f4ca67beae68b2b7fb8030bd9c3b.tar.bz2
opensim-SC-05810e48b013f4ca67beae68b2b7fb8030bd9c3b.tar.xz
Merge commit 'c92654fb43f303da8e1623f9fff8a404aad72374' into careminster
Conflicts: OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs29
1 files changed, 13 insertions, 16 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 207c900..9d7b44b 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -367,12 +367,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
367 sp.ClearAttachments(); 367 sp.ClearAttachments();
368 } 368 }
369 369
370 public bool AttachObject(IScenePresence sp, SceneObjectGroup group, uint attachmentPt, bool silent, bool useAttachData, bool temp, bool append) 370 public bool AttachObject(IScenePresence sp, SceneObjectGroup group, uint attachmentPt, bool silent, bool useAttachData, bool addToInventory, bool append)
371 { 371 {
372 if (!Enabled) 372 if (!Enabled)
373 return false; 373 return false;
374 374
375 return AttachObjectInternal(sp, group, attachmentPt, silent, useAttachData, temp, false, append); 375 return AttachObjectInternal(sp, group, attachmentPt, silent, useAttachData, addToInventory, false, append);
376 } 376 }
377 377
378 /// <summary> 378 /// <summary>
@@ -383,9 +383,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
383 /// <param name='group'>The object to attach.</param> 383 /// <param name='group'>The object to attach.</param>
384 /// <param name='attachmentPt'></param> 384 /// <param name='attachmentPt'></param>
385 /// <param name='silent'></param> 385 /// <param name='silent'></param>
386 /// <param name='temp'></param> 386 /// <param name='addToInventory'>If true then add object to user inventory.</param>
387 /// <param name='resumeScripts'>If true then scripts are resumed on the attached object.</param> 387 /// <param name='resumeScripts'>If true then scripts are resumed on the attached object.</param>
388 private bool AttachObjectInternal(IScenePresence sp, SceneObjectGroup group, uint attachmentPt, bool silent, bool useAttachData, bool temp, bool resumeScripts, bool append) 388 private bool AttachObjectInternal(IScenePresence sp, SceneObjectGroup group, uint attachmentPt, bool silent, bool useAttachData, bool addToInventory, bool resumeScripts, bool append)
389 { 389 {
390// m_log.DebugFormat( 390// m_log.DebugFormat(
391// "[ATTACHMENTS MODULE]: Attaching object {0} {1} to {2} point {3} from ground (silent = {4})", 391// "[ATTACHMENTS MODULE]: Attaching object {0} {1} to {2} point {3} from ground (silent = {4})",
@@ -474,8 +474,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
474 group.AttachmentPoint = attachmentPt; 474 group.AttachmentPoint = attachmentPt;
475 group.AbsolutePosition = attachPos; 475 group.AbsolutePosition = attachPos;
476 476
477 if (sp.PresenceType != PresenceType.Npc) 477 if (addToInventory && sp.PresenceType != PresenceType.Npc)
478 UpdateUserInventoryWithAttachment(sp, group, attachmentPt, temp, append); 478 UpdateUserInventoryWithAttachment(sp, group, attachmentPt, append);
479 479
480 AttachToAgent(sp, group, attachmentPt, attachPos, silent); 480 AttachToAgent(sp, group, attachmentPt, attachPos, silent);
481 481
@@ -494,17 +494,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
494 return true; 494 return true;
495 } 495 }
496 496
497 private void UpdateUserInventoryWithAttachment(IScenePresence sp, SceneObjectGroup group, uint attachmentPt, bool temp, bool append) 497 private void UpdateUserInventoryWithAttachment(IScenePresence sp, SceneObjectGroup group, uint attachmentPt, bool append)
498 { 498 {
499 // Add the new attachment to inventory if we don't already have it. 499 // Add the new attachment to inventory if we don't already have it.
500 if (!temp) 500 UUID newAttachmentItemID = group.FromItemID;
501 { 501 if (newAttachmentItemID == UUID.Zero)
502 UUID newAttachmentItemID = group.FromItemID; 502 newAttachmentItemID = AddSceneObjectAsNewAttachmentInInv(sp, group).ID;
503 if (newAttachmentItemID == UUID.Zero)
504 newAttachmentItemID = AddSceneObjectAsNewAttachmentInInv(sp, group).ID;
505 503
506 ShowAttachInUserInventory(sp, attachmentPt, newAttachmentItemID, group, append); 504 ShowAttachInUserInventory(sp, attachmentPt, newAttachmentItemID, group, append);
507 }
508 } 505 }
509 506
510 public ISceneEntity RezSingleAttachmentFromInventory(IScenePresence sp, UUID itemID, uint AttachmentPt) 507 public ISceneEntity RezSingleAttachmentFromInventory(IScenePresence sp, UUID itemID, uint AttachmentPt)
@@ -1010,7 +1007,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
1010 objatt.ResetOwnerChangeFlag(); 1007 objatt.ResetOwnerChangeFlag();
1011 } 1008 }
1012 1009
1013 AttachObjectInternal(sp, objatt, attachmentPt, false, true, false, true, append); 1010 AttachObjectInternal(sp, objatt, attachmentPt, false, true, true, true, append);
1014 } 1011 }
1015 catch (Exception e) 1012 catch (Exception e)
1016 { 1013 {
@@ -1152,7 +1149,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
1152 AttachmentPt &= 0x7f; 1149 AttachmentPt &= 0x7f;
1153 1150
1154 // Calls attach with a Zero position 1151 // Calls attach with a Zero position
1155 if (AttachObject(sp, part.ParentGroup, AttachmentPt, false, true, false, append)) 1152 if (AttachObject(sp, part.ParentGroup, AttachmentPt, false, false, false, append))
1156 { 1153 {
1157 if (DebugLevel > 0) 1154 if (DebugLevel > 0)
1158 m_log.Debug( 1155 m_log.Debug(