aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs18
1 files changed, 17 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 2818712..d0e0b35 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -422,6 +422,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
422 attachPos = Vector3.Zero; 422 attachPos = Vector3.Zero;
423 } 423 }
424 424
425 // if the attachment point is the same as previous, make sure we get the saved
426 // position info.
427 if (attachmentPt != 0 && attachmentPt == group.RootPart.Shape.LastAttachPoint)
428 {
429 attachPos = group.RootPart.AttachedPos;
430 }
431
425 // AttachmentPt 0 means the client chose to 'wear' the attachment. 432 // AttachmentPt 0 means the client chose to 'wear' the attachment.
426 if (attachmentPt == (uint)AttachmentPoint.Default) 433 if (attachmentPt == (uint)AttachmentPoint.Default)
427 { 434 {
@@ -429,6 +436,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
429 attachmentPt = group.AttachmentPoint; 436 attachmentPt = group.AttachmentPoint;
430 } 437 }
431 438
439 // if we didn't find an attach point, look for where it was last attached
440 if (attachmentPt == 0)
441 {
442 attachmentPt = (uint)group.RootPart.Shape.LastAttachPoint;
443 attachPos = group.RootPart.AttachedPos;
444 group.HasGroupChanged = true;
445 }
446
432 // if we still didn't find a suitable attachment point....... 447 // if we still didn't find a suitable attachment point.......
433 if (attachmentPt == 0) 448 if (attachmentPt == 0)
434 { 449 {
@@ -619,6 +634,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
619 so.ClearPartAttachmentData(); 634 so.ClearPartAttachmentData();
620 rootPart.ApplyPhysics(rootPart.GetEffectiveObjectFlags(), rootPart.VolumeDetectActive); 635 rootPart.ApplyPhysics(rootPart.GetEffectiveObjectFlags(), rootPart.VolumeDetectActive);
621 so.HasGroupChanged = true; 636 so.HasGroupChanged = true;
637 so.RootPart.Shape.LastAttachPoint = (byte)so.AttachmentPoint;
622 rootPart.Rezzed = DateTime.Now; 638 rootPart.Rezzed = DateTime.Now;
623 rootPart.RemFlag(PrimFlags.TemporaryOnRez); 639 rootPart.RemFlag(PrimFlags.TemporaryOnRez);
624 so.AttachToBackup(); 640 so.AttachToBackup();
@@ -1210,4 +1226,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
1210 1226
1211 #endregion 1227 #endregion
1212 } 1228 }
1213} \ No newline at end of file 1229}