mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 19:36:07 +08:00
Selling an object in-place (as original) now works. Builders can
now ply their trade. Is that nuts?
This commit is contained in:
@@ -1312,6 +1312,11 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
{
|
||||
if (((SceneObjectGroup)ent).LocalId == childPrims[i])
|
||||
{
|
||||
// Make sure no child prim is set for sale
|
||||
// So that, on delink, no prims are unwittingly
|
||||
// left for sale and sold off
|
||||
((SceneObjectGroup)ent).RootPart.ObjectSaleType = 0;
|
||||
((SceneObjectGroup)ent).RootPart.SalePrice = 10;
|
||||
children.Add((SceneObjectGroup)ent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1985,6 +1985,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
if (rootPart.OwnerID != item.Owner)
|
||||
{
|
||||
//Need to kill the for sale here
|
||||
rootPart.ObjectSaleType = 0;
|
||||
rootPart.SalePrice = 10;
|
||||
|
||||
if (ExternalChecks.ExternalChecksPropagatePermissions())
|
||||
{
|
||||
if ((item.CurrentPermissions & 8) != 0)
|
||||
|
||||
@@ -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<SceneObjectPart> partList =
|
||||
new List<SceneObjectPart>(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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user