aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorCharles Krinke2008-06-26 02:46:29 +0000
committerCharles Krinke2008-06-26 02:46:29 +0000
commit1cd6b71b60d093b451ba03881ee31efd3eb29a50 (patch)
tree71e51114e772d9d9121a449a684e9c7f8a8e5a16 /OpenSim/Region/ScriptEngine/Shared
parentMinor refactoring of POS. Adds a Util.Clamp(x, min, max) function. (diff)
downloadopensim-SC_OLD-1cd6b71b60d093b451ba03881ee31efd3eb29a50.zip
opensim-SC_OLD-1cd6b71b60d093b451ba03881ee31efd3eb29a50.tar.gz
opensim-SC_OLD-1cd6b71b60d093b451ba03881ee31efd3eb29a50.tar.bz2
opensim-SC_OLD-1cd6b71b60d093b451ba03881ee31efd3eb29a50.tar.xz
Mantis#1594. Thank you, Melanie for a patch that:
Fixes: - Wearable icon and name sreset to default on copy/paste - Cache is not updated when renaming/moving folders - Partial refactor to make inventory less dependen on AssetBase having a "Name" field - Add llGiveInventoryList() function
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs38
1 files changed, 37 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 57c1e02..1d4a72e 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -36,6 +36,7 @@ using Axiom.Math;
36using libsecondlife; 36using libsecondlife;
37using OpenSim; 37using OpenSim;
38using OpenSim.Framework; 38using OpenSim.Framework;
39using OpenSim.Framework.Communications.Cache;
39using OpenSim.Region.Environment; 40using OpenSim.Region.Environment;
40using OpenSim.Region.Environment.Interfaces; 41using OpenSim.Region.Environment.Interfaces;
41using OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney; 42using OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney;
@@ -4226,10 +4227,45 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4226 NotImplemented("llGroundRepel"); 4227 NotImplemented("llGroundRepel");
4227 } 4228 }
4228 4229
4230 private LLUUID GetTaskInventoryItem(string name)
4231 {
4232 foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory)
4233 {
4234 if(inv.Value.Name == name)
4235 return inv.Key;
4236 }
4237 return LLUUID.Zero;
4238 }
4239
4229 public void llGiveInventoryList(string destination, string category, LSL_Types.list inventory) 4240 public void llGiveInventoryList(string destination, string category, LSL_Types.list inventory)
4230 { 4241 {
4231 m_host.AddScriptLPS(1); 4242 m_host.AddScriptLPS(1);
4232 NotImplemented("llGiveInventoryList"); 4243
4244 LLUUID destID;
4245 if(!LLUUID.TryParse(destination, out destID))
4246 return;
4247
4248 List<LLUUID> itemList = new List<LLUUID>();
4249
4250 foreach (Object item in inventory.Data)
4251 {
4252 LLUUID itemID;
4253 if(LLUUID.TryParse(item.ToString(), out itemID))
4254 {
4255 itemList.Add(itemID);
4256 }
4257 else
4258 {
4259 itemID = GetTaskInventoryItem(item.ToString());
4260 if(itemID != LLUUID.Zero)
4261 itemList.Add(itemID);
4262 }
4263 }
4264
4265 if(itemList.Count == 0)
4266 return;
4267
4268 m_ScriptEngine.World.MoveTaskInventoryItems(destID, category, m_host, itemList);
4233 } 4269 }
4234 4270
4235 public void llSetVehicleType(int type) 4271 public void llSetVehicleType(int type)