diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 7a91481..de40e59 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -638,19 +638,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
638 | // "[ATTACHMENTS MODULE]: Called AddSceneObjectAsAttachment for object {0} {1} for {2}", | 638 | // "[ATTACHMENTS MODULE]: Called AddSceneObjectAsAttachment for object {0} {1} for {2}", |
639 | // grp.Name, grp.LocalId, remoteClient.Name); | 639 | // grp.Name, grp.LocalId, remoteClient.Name); |
640 | 640 | ||
641 | Vector3 inventoryStoredPosition = new Vector3 | 641 | // Vector3 inventoryStoredPosition = new Vector3 |
642 | (((grp.AbsolutePosition.X > (int)Constants.RegionSize) | 642 | // (((grp.AbsolutePosition.X > (int)Constants.RegionSize) |
643 | ? (float)Constants.RegionSize - 6 | 643 | // ? (float)Constants.RegionSize - 6 |
644 | : grp.AbsolutePosition.X) | 644 | // : grp.AbsolutePosition.X) |
645 | , | 645 | // , |
646 | (grp.AbsolutePosition.Y > (int)Constants.RegionSize) | 646 | // (grp.AbsolutePosition.Y > (int)Constants.RegionSize) |
647 | ? (float)Constants.RegionSize - 6 | 647 | // ? (float)Constants.RegionSize - 6 |
648 | : grp.AbsolutePosition.Y, | 648 | // : grp.AbsolutePosition.Y, |
649 | grp.AbsolutePosition.Z); | 649 | // grp.AbsolutePosition.Z); |
650 | 650 | // | |
651 | Vector3 originalPosition = grp.AbsolutePosition; | 651 | // Vector3 originalPosition = grp.AbsolutePosition; |
652 | 652 | // | |
653 | grp.AbsolutePosition = inventoryStoredPosition; | 653 | // grp.AbsolutePosition = inventoryStoredPosition; |
654 | 654 | ||
655 | // If we're being called from a script, then trying to serialize that same script's state will not complete | 655 | // If we're being called from a script, then trying to serialize that same script's state will not complete |
656 | // in any reasonable time period. Therefore, we'll avoid it. The worst that can happen is that if | 656 | // in any reasonable time period. Therefore, we'll avoid it. The worst that can happen is that if |
@@ -658,7 +658,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
658 | // without state on relog. Arguably, this is what we want anyway. | 658 | // without state on relog. Arguably, this is what we want anyway. |
659 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp, false); | 659 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp, false); |
660 | 660 | ||
661 | grp.AbsolutePosition = originalPosition; | 661 | // grp.AbsolutePosition = originalPosition; |
662 | 662 | ||
663 | AssetBase asset = m_scene.CreateAsset( | 663 | AssetBase asset = m_scene.CreateAsset( |
664 | grp.GetPartName(grp.LocalId), | 664 | grp.GetPartName(grp.LocalId), |
@@ -686,21 +686,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
686 | else // oopsies | 686 | else // oopsies |
687 | item.Folder = UUID.Zero; | 687 | item.Folder = UUID.Zero; |
688 | 688 | ||
689 | // Nix the special bits we used to use for slam and the folded perms | ||
690 | uint allowablePermissionsMask = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move); | ||
691 | |||
689 | if ((sp.UUID != grp.RootPart.OwnerID) && m_scene.Permissions.PropagatePermissions()) | 692 | if ((sp.UUID != grp.RootPart.OwnerID) && m_scene.Permissions.PropagatePermissions()) |
690 | { | 693 | { |
691 | item.BasePermissions = grp.RootPart.NextOwnerMask; | 694 | item.BasePermissions = grp.RootPart.BaseMask & grp.RootPart.NextOwnerMask & allowablePermissionsMask; |
692 | item.CurrentPermissions = grp.RootPart.NextOwnerMask; | 695 | item.CurrentPermissions = grp.RootPart.BaseMask & grp.RootPart.NextOwnerMask & allowablePermissionsMask; |
693 | item.NextPermissions = grp.RootPart.NextOwnerMask; | 696 | item.NextPermissions = grp.RootPart.NextOwnerMask & allowablePermissionsMask; |
694 | item.EveryOnePermissions = grp.RootPart.EveryoneMask & grp.RootPart.NextOwnerMask; | 697 | item.EveryOnePermissions = grp.RootPart.EveryoneMask & grp.RootPart.NextOwnerMask & allowablePermissionsMask; |
695 | item.GroupPermissions = grp.RootPart.GroupMask & grp.RootPart.NextOwnerMask; | 698 | item.GroupPermissions = grp.RootPart.GroupMask & grp.RootPart.NextOwnerMask & allowablePermissionsMask; |
696 | } | 699 | } |
697 | else | 700 | else |
698 | { | 701 | { |
699 | item.BasePermissions = grp.RootPart.BaseMask; | 702 | item.BasePermissions = grp.RootPart.BaseMask & allowablePermissionsMask; |
700 | item.CurrentPermissions = grp.RootPart.OwnerMask; | 703 | item.CurrentPermissions = grp.RootPart.OwnerMask & allowablePermissionsMask; |
701 | item.NextPermissions = grp.RootPart.NextOwnerMask; | 704 | item.NextPermissions = grp.RootPart.NextOwnerMask & allowablePermissionsMask; |
702 | item.EveryOnePermissions = grp.RootPart.EveryoneMask; | 705 | item.EveryOnePermissions = grp.RootPart.EveryoneMask & allowablePermissionsMask; |
703 | item.GroupPermissions = grp.RootPart.GroupMask; | 706 | item.GroupPermissions = grp.RootPart.GroupMask & allowablePermissionsMask; |
704 | } | 707 | } |
705 | item.CreationDate = Util.UnixTimeSinceEpoch(); | 708 | item.CreationDate = Util.UnixTimeSinceEpoch(); |
706 | 709 | ||