aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs54
1 files changed, 27 insertions, 27 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index d489821..72ba3cf 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -314,6 +314,33 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
314 return false; 314 return false;
315 } 315 }
316 316
317 Vector3 attachPos = group.AbsolutePosition;
318 // If the attachment point isn't the same as the one previously used
319 // set it's offset position = 0 so that it appears on the attachment point
320 // and not in a weird location somewhere unknown.
321 if (attachmentPt != (uint)AttachmentPoint.Default && attachmentPt != group.AttachmentPoint)
322 {
323 attachPos = Vector3.Zero;
324 }
325
326 // AttachmentPt 0 means the client chose to 'wear' the attachment.
327 if (attachmentPt == (uint)AttachmentPoint.Default)
328 {
329 // Check object for stored attachment point
330 attachmentPt = group.AttachmentPoint;
331 }
332
333 // if we still didn't find a suitable attachment point.......
334 if (attachmentPt == 0)
335 {
336 // Stick it on left hand with Zero Offset from the attachment point.
337 attachmentPt = (uint)AttachmentPoint.LeftHand;
338 attachPos = Vector3.Zero;
339 }
340
341 group.AttachmentPoint = attachmentPt;
342 group.AbsolutePosition = attachPos;
343
317 List<SceneObjectGroup> attachments = sp.GetAttachments(attachmentPt); 344 List<SceneObjectGroup> attachments = sp.GetAttachments(attachmentPt);
318 345
319 if (attachments.Contains(group)) 346 if (attachments.Contains(group))
@@ -345,33 +372,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
345 372
346 lock (sp.AttachmentsSyncLock) 373 lock (sp.AttachmentsSyncLock)
347 { 374 {
348 Vector3 attachPos = group.AbsolutePosition;
349 // If the attachment point isn't the same as the one previously used
350 // set it's offset position = 0 so that it appears on the attachment point
351 // and not in a weird location somewhere unknown.
352 if (attachmentPt != 0 && attachmentPt != group.AttachmentPoint)
353 {
354 attachPos = Vector3.Zero;
355 }
356
357 // AttachmentPt 0 means the client chose to 'wear' the attachment.
358 if (attachmentPt == 0)
359 {
360 // Check object for stored attachment point
361 attachmentPt = group.AttachmentPoint;
362 }
363
364 // if we still didn't find a suitable attachment point.......
365 if (attachmentPt == 0)
366 {
367 // Stick it on left hand with Zero Offset from the attachment point.
368 attachmentPt = (uint)AttachmentPoint.LeftHand;
369 attachPos = Vector3.Zero;
370 }
371
372 group.AttachmentPoint = attachmentPt;
373 group.AbsolutePosition = attachPos;
374
375 if (sp.PresenceType != PresenceType.Npc) 375 if (sp.PresenceType != PresenceType.Npc)
376 UpdateUserInventoryWithAttachment(sp, group, attachmentPt, temp, append); 376 UpdateUserInventoryWithAttachment(sp, group, attachmentPt, temp, append);
377 377