mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +08:00
Forward-port 0.6 fix
This commit is contained in:
@@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
|
||||
part.GetProperties(client);
|
||||
}
|
||||
|
||||
public bool BuyObject(IClientAPI remoteClient, UUID categoryID, uint localID, byte saleType)
|
||||
public bool BuyObject(IClientAPI remoteClient, UUID categoryID, uint localID, byte saleType, int salePrice)
|
||||
{
|
||||
SceneObjectPart part = m_scene.GetSceneObjectPart(localID);
|
||||
|
||||
@@ -114,6 +114,18 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
|
||||
if (part.ParentGroup == null)
|
||||
return false;
|
||||
|
||||
if (part.ObjectSaleType != saleType)
|
||||
{
|
||||
m_dialogModule.SendAlertToUser(remoteClient, "This item is not available for the type of sale specified");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (part.SalePrice != salePrice)
|
||||
{
|
||||
m_dialogModule.SendAlertToUser(remoteClient, "This item is not available for the price specified");
|
||||
return false;
|
||||
}
|
||||
|
||||
SceneObjectGroup group = part.ParentGroup;
|
||||
|
||||
switch (saleType)
|
||||
|
||||
@@ -42,6 +42,6 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// <returns>
|
||||
/// True on a successful purchase, false on failure
|
||||
/// </returns>
|
||||
bool BuyObject(IClientAPI remoteClient, UUID categoryID, uint localID, byte saleType);
|
||||
bool BuyObject(IClientAPI remoteClient, UUID categoryID, uint localID, byte saleType, int salePrice);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -814,7 +814,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
|
||||
|
||||
IBuySellModule module = s.RequestModuleInterface<IBuySellModule>();
|
||||
if (module != null)
|
||||
module.BuyObject(remoteClient, categoryID, localID, saleType);
|
||||
module.BuyObject(remoteClient, categoryID, localID, saleType, salePrice);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -825,4 +825,4 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
|
||||
Gift = 2,
|
||||
Purchase = 3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user