diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs index 142c8b7..90d65c7 100644 --- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs | |||
@@ -89,28 +89,23 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell | |||
89 | if (part == null) | 89 | if (part == null) |
90 | return; | 90 | return; |
91 | 91 | ||
92 | if (part.ParentGroup.IsDeleted) | 92 | SceneObjectGroup sog = part.ParentGroup; |
93 | if (sog == null || sog.IsDeleted) | ||
93 | return; | 94 | return; |
94 | 95 | ||
95 | if (part.OwnerID != part.GroupID && part.OwnerID != client.AgentId && (!m_scene.Permissions.IsGod(client.AgentId))) | 96 | // Does the user have the power to put the object on sale? |
96 | return; | 97 | if (!m_scene.Permissions.CanSellObject(client, sog, saleType)) |
97 | |||
98 | if (part.OwnerID == part.GroupID) // Group owned | ||
99 | { | 98 | { |
100 | // Does the user have the power to put the object on sale? | 99 | client.SendAgentAlertMessage("You don't have permission to set object on sale", false); |
101 | if (!m_scene.Permissions.CanSellGroupObject(client.AgentId, part.GroupID)) | 100 | return; |
102 | { | ||
103 | client.SendAgentAlertMessage("You don't have permission to set group-owned objects on sale", false); | ||
104 | return; | ||
105 | } | ||
106 | } | 101 | } |
107 | 102 | ||
108 | part = part.ParentGroup.RootPart; | 103 | part = sog.RootPart; |
109 | 104 | ||
110 | part.ObjectSaleType = saleType; | 105 | part.ObjectSaleType = saleType; |
111 | part.SalePrice = salePrice; | 106 | part.SalePrice = salePrice; |
112 | 107 | ||
113 | part.ParentGroup.HasGroupChanged = true; | 108 | sog.HasGroupChanged = true; |
114 | 109 | ||
115 | part.SendPropertiesToClient(client); | 110 | part.SendPropertiesToClient(client); |
116 | } | 111 | } |