From 07cb1d4f0e9acfaba22b9b8ef1611613ab827a1a Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 24 Aug 2008 06:39:54 +0000 Subject: Selling an object in-place (as original) now works. Builders can now ply their trade. Is that nuts? --- OpenSim/Region/Environment/Scenes/Scene.cs | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 36471e9..01a0fc8 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -3948,6 +3948,44 @@ namespace OpenSim.Region.Environment.Scenes public void PerformObjectBuy(IClientAPI remoteClient, LLUUID categoryID, uint localID, byte saleType) { + SceneObjectPart part = GetSceneObjectPart(localID); + + if(part == null) + return; + + switch (saleType) + { + case 1: // Sell as original (in-place sale) + if(part.ParentGroup == null) + return; + + part.ParentGroup.SetOwnerId(remoteClient.AgentId); + part.ParentGroup.SetRootPartOwner(part, remoteClient.AgentId, + remoteClient.ActiveGroupId); + + List partList = + new List(part.ParentGroup.Children.Values); + + if (ExternalChecks.ExternalChecksPropagatePermissions()) + { + foreach (SceneObjectPart child in partList) + { + child.OwnerMask &= child.NextOwnerMask; + child.GroupMask &= child.NextOwnerMask; + child.EveryoneMask &= child.NextOwnerMask; + child.BaseMask &= child.NextOwnerMask; + } + } + + part.ObjectSaleType = 0; + part.SalePrice = 10; + + part.ParentGroup.HasGroupChanged = true; + part.GetProperties(remoteClient); + part.ScheduleFullUpdate(); + + break; + } } } } -- cgit v1.1