diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 54715a80ac..a1629fba10 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs @@ -633,12 +633,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver // Validate User and Group UUID's + if (!ResolveGroupUuid(parcel.GroupID)) + parcel.GroupID = UUID.Zero; + if (parcel.IsGroupOwned) { - if (!ResolveGroupUuid(parcel.GroupID)) + if (parcel.GroupID != UUID.Zero) + { + // In group-owned parcels, OwnerID=GroupID. This should already be the case, but let's make sure. + parcel.OwnerID = parcel.GroupID; + } + else { parcel.OwnerID = m_rootScene.RegionInfo.EstateSettings.EstateOwner; - parcel.GroupID = UUID.Zero; parcel.IsGroupOwned = false; } } @@ -646,9 +653,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver { if (!ResolveUserUuid(scene, parcel.OwnerID)) parcel.OwnerID = m_rootScene.RegionInfo.EstateSettings.EstateOwner; - - if (!ResolveGroupUuid(parcel.GroupID)) - parcel.GroupID = UUID.Zero; } List accessList = new List(); diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 0ecf13bc36..5ab97ffc22 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -1543,8 +1543,7 @@ namespace OpenSim.Region.CoreModules.World.Land private void IncomingLandObjectFromStorage(LandData data) { - ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene); - new_land.LandData = data.Copy(); + ILandObject new_land = new LandObject(data, m_scene); new_land.SetLandBitmapFromByteArray(); AddLandObject(new_land); } diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index af19ca3ad9..57fa4d990b 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -120,6 +120,12 @@ namespace OpenSim.Region.CoreModules.World.Land #region Constructors + public LandObject(LandData landData, Scene scene) + { + LandData = landData.Copy(); + m_scene = scene; + } + public LandObject(UUID owner_id, bool is_group_owned, Scene scene) { m_scene = scene; @@ -163,12 +169,8 @@ namespace OpenSim.Region.CoreModules.World.Land public ILandObject Copy() { - ILandObject newLand = new LandObject(LandData.OwnerID, LandData.IsGroupOwned, m_scene); - - //Place all new variables here! + ILandObject newLand = new LandObject(LandData, m_scene); newLand.LandBitmap = (bool[,]) (LandBitmap.Clone()); - newLand.LandData = LandData.Copy(); - return newLand; } diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 2ccb28d0d8..e6887b46ba 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4516,29 +4516,18 @@ namespace OpenSim.Region.Framework.Scenes { return true; } - else if ((parcel.LandData.Flags & (uint)ParcelFlags.AllowGroupScripts) != 0) + else if ((part.OwnerID == parcel.LandData.OwnerID) || Permissions.IsGod(part.OwnerID)) { - if (part.OwnerID == parcel.LandData.OwnerID - || (parcel.LandData.IsGroupOwned && part.GroupID == parcel.LandData.GroupID) - || Permissions.IsGod(part.OwnerID)) - { - return true; - } - else - { - return false; - } + return true; + } + else if (((parcel.LandData.Flags & (uint)ParcelFlags.AllowGroupScripts) != 0) + && (parcel.LandData.GroupID != UUID.Zero) && (parcel.LandData.GroupID == part.GroupID)) + { + return true; } else { - if (part.OwnerID == parcel.LandData.OwnerID) - { - return true; - } - else - { - return false; - } + return false; } } else