diff --git a/OpenSim/Framework/IMoneyModule.cs b/OpenSim/Framework/IMoneyModule.cs index 415b7df92c..55c9613b6a 100644 --- a/OpenSim/Framework/IMoneyModule.cs +++ b/OpenSim/Framework/IMoneyModule.cs @@ -33,7 +33,7 @@ namespace OpenSim.Framework public interface IMoneyModule { bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, - int amount, UUID txn); + int amount, UUID txn, out string reason); int GetBalance(UUID agentID); bool UploadCovered(UUID agentID, int amount); diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 588da10602..aa00145afe 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -794,6 +794,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess XmlDocument doc = new XmlDocument(); doc.LoadXml(xmlData); XmlElement e = (XmlElement)doc.SelectSingleNode("/CoalescedObject"); + Vector3 rez_pos; if (e == null || attachment) // Single { SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); @@ -815,6 +816,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess RayStart, RayEnd, RayTargetID, Quaternion.Identity, BypassRayCast, bRayEndIsIntersection, true, g.GetAxisAlignedBoundingBox(out offsetHeight), false); pos.Z += offsetHeight; + rez_pos = pos; } else { @@ -829,6 +831,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess BypassRayCast, bRayEndIsIntersection, true, bbox, false); + rez_pos = pos; + pos -= bbox / 2; XmlNodeList groups = e.SelectNodes("SceneObjectGroup"); @@ -865,7 +869,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess primcount += g.PrimCount; if (!m_Scene.Permissions.CanRezObject( - primcount, remoteClient.AgentId, pos) + primcount, remoteClient.AgentId, rez_pos) && !attachment) { // The client operates in no fail mode. It will @@ -882,7 +886,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess return null; } - if (item != null && !DoPreRezWhenFromItem(remoteClient, item, objlist, pos, veclist, attachment)) + if (item != null && !DoPreRezWhenFromItem(remoteClient, item, objlist, rez_pos, veclist, attachment)) return null; for (int i = 0; i < objlist.Count; i++) diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index 25f198b592..bcb21d0837 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs @@ -203,8 +203,9 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule { } - public bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, int amount, UUID txn) + public bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, int amount, UUID txn, out string result) { + result = String.Empty; string description = String.Format("Object {0} pays {1}", resolveObjectName(objectID), resolveAgentName(toID)); bool give_result = doMoneyTransfer(fromID, toID, amount, 2, description); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index d5f14bf437..f05aaa9983 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3180,8 +3180,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; } + string reason; money.ObjectGiveMoney( - m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount,UUID.Zero); + m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount,UUID.Zero, out reason); }); return 0; @@ -12841,8 +12842,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; } + string reason; bool result = money.ObjectGiveMoney( - m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount, txn); + m_host.ParentGroup.RootPart.UUID, m_host.ParentGroup.RootPart.OwnerID, toID, amount, txn, out reason); if (result) { @@ -12850,7 +12852,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; } - replydata = "LINDENDOLLAR_INSUFFICIENTFUNDS"; + replydata = reason; } finally {