diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 18 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 8 |
2 files changed, 25 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 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 68e4e26..0ec9575 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -836,6 +836,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
836 | m_log.Debug("[INVENTORY ACCESS MODULE]: Object has UUID.Zero! Position 3"); | 836 | m_log.Debug("[INVENTORY ACCESS MODULE]: Object has UUID.Zero! Position 3"); |
837 | } | 837 | } |
838 | 838 | ||
839 | // if this was previously an attachment and is now being rezzed, | ||
840 | // save the old attachment info. | ||
841 | if (group.IsAttachment == false && group.RootPart.Shape.State != 0) | ||
842 | { | ||
843 | group.RootPart.AttachedPos = group.AbsolutePosition; | ||
844 | group.RootPart.Shape.LastAttachPoint = (byte)group.AttachmentPoint; | ||
845 | } | ||
846 | |||
839 | foreach (SceneObjectPart part in group.Parts) | 847 | foreach (SceneObjectPart part in group.Parts) |
840 | { | 848 | { |
841 | // Make the rezzer the owner, as this is not necessarily set correctly in the serialized asset. | 849 | // Make the rezzer the owner, as this is not necessarily set correctly in the serialized asset. |