From 90b51dc7d67507e27c4baa529e979de19dce8de1 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 30 Sep 2010 15:52:33 +0100
Subject: Forward-port 0.6 fix
---
.../CoreModules/World/Objects/BuySell/BuySellModule.cs | 14 +++++++++++++-
OpenSim/Region/Framework/Interfaces/IBuySellModule.cs | 4 ++--
.../OptionalModules/World/MoneyModule/SampleMoneyModule.cs | 4 ++--
3 files changed, 17 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
index c8fb9da..a674d60 100644
--- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
+++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
@@ -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)
diff --git a/OpenSim/Region/Framework/Interfaces/IBuySellModule.cs b/OpenSim/Region/Framework/Interfaces/IBuySellModule.cs
index 0132bae..d1ce4c0 100644
--- a/OpenSim/Region/Framework/Interfaces/IBuySellModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IBuySellModule.cs
@@ -42,6 +42,6 @@ namespace OpenSim.Region.Framework.Interfaces
///
/// True on a successful purchase, false on failure
///
- bool BuyObject(IClientAPI remoteClient, UUID categoryID, uint localID, byte saleType);
+ bool BuyObject(IClientAPI remoteClient, UUID categoryID, uint localID, byte saleType, int salePrice);
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs
index cc51c3b..d364df6 100644
--- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs
+++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs
@@ -814,7 +814,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
IBuySellModule module = s.RequestModuleInterface();
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
}
-}
\ No newline at end of file
+}
--
cgit v1.1