From 6ccb9948ab9df1004862f997150edc5869ddbbbf Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Wed, 13 Aug 2008 14:06:21 +0000 Subject: Mantis#1925. Thank you, homerHorwitz for a patch that: This fixes the coordinates returned by doing a llRequestInventoryData on a landmark. --- .../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 31 +++++++++++++++++++++- .../Shared/Api/Implementation/LSL_Api.cs | 5 ++-- 2 files changed, 33 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index d2a15aa..41703cd 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -2986,7 +2986,36 @@ namespace OpenSim.Region.ScriptEngine.Common public string llRequestInventoryData(string name) { m_host.AddScriptLPS(1); - NotImplemented("llRequestInventoryData"); + foreach (TaskInventoryItem item in m_host.TaskInventory.Values) + { + if (item.Type == 3 && item.Name == name) + { + LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager.m_Dataserver.RegisterRequest( + m_localID, m_itemID, item.AssetID.ToString()); + + LLVector3 region = new LLVector3( + World.RegionInfo.RegionLocX * Constants.RegionSize, + World.RegionInfo.RegionLocY * Constants.RegionSize, + 0); + + World.AssetCache.GetAsset(item.AssetID, + delegate(LLUUID i, AssetBase a) + { + AssetLandmark lm = new AssetLandmark(a); + + float rx = (uint)(lm.RegionHandle >> 32); + float ry = (uint)lm.RegionHandle; + region = lm.Position + new LLVector3(rx, ry, 0) - region; + + string reply = region.ToString(); + m_ScriptEngine.m_ASYNCLSLCommandManager. + m_Dataserver.DataserverReply(i.ToString(), + reply); + }, false); + + return tid.ToString(); + } + } return String.Empty; } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index d7633d8..17e8253 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2917,10 +2917,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { AssetLandmark lm = new AssetLandmark(a); - region += lm.Position; + float rx = (uint)(lm.RegionHandle >> 32); + float ry = (uint)lm.RegionHandle; + region = lm.Position + new LLVector3(rx, ry, 0) - region; string reply = region.ToString(); - AsyncCommands. DataserverPlugin.DataserverReply(i.ToString(), reply); -- cgit v1.1