aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-07-04 21:47:20 +0100
committerJustin Clark-Casey (justincc)2012-07-04 21:47:20 +0100
commitd933bdbd59da50e2c335b65870416ac8e5035d3a (patch)
tree667dcfd789083f4de1e12966ea47e8da27fe62ac /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
parentrefactor: in llGetInventoryPermMask use existing GetInventoryItem() (diff)
downloadopensim-SC_OLD-d933bdbd59da50e2c335b65870416ac8e5035d3a.zip
opensim-SC_OLD-d933bdbd59da50e2c335b65870416ac8e5035d3a.tar.gz
opensim-SC_OLD-d933bdbd59da50e2c335b65870416ac8e5035d3a.tar.bz2
opensim-SC_OLD-d933bdbd59da50e2c335b65870416ac8e5035d3a.tar.xz
refactor: In llGetInventoryPermMask() use existing GetInventoryItem()
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs45
1 files changed, 21 insertions, 24 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index a173d64..fce09bf 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -9058,38 +9058,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9058 return -1; 9058 return -1;
9059 } 9059 }
9060 9060
9061 public void llSetInventoryPermMask(string item, int mask, int value) 9061 public void llSetInventoryPermMask(string itemName, int mask, int value)
9062 { 9062 {
9063 m_host.AddScriptLPS(1); 9063 m_host.AddScriptLPS(1);
9064
9064 if (m_ScriptEngine.Config.GetBoolean("AllowGodFunctions", false)) 9065 if (m_ScriptEngine.Config.GetBoolean("AllowGodFunctions", false))
9065 { 9066 {
9066 if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) 9067 if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID))
9067 { 9068 {
9068 lock (m_host.TaskInventory) 9069 TaskInventoryItem item = m_host.Inventory.GetInventoryItem(itemName);
9070
9071 if (item != null)
9069 { 9072 {
9070 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory) 9073 switch (mask)
9071 { 9074 {
9072 if (inv.Value.Name == item) 9075 case 0:
9073 { 9076 item.BasePermissions = (uint)value;
9074 switch (mask) 9077 break;
9075 { 9078 case 1:
9076 case 0: 9079 item.CurrentPermissions = (uint)value;
9077 inv.Value.BasePermissions = (uint)value; 9080 break;
9078 break; 9081 case 2:
9079 case 1: 9082 item.GroupPermissions = (uint)value;
9080 inv.Value.CurrentPermissions = (uint)value; 9083 break;
9081 break; 9084 case 3:
9082 case 2: 9085 item.EveryonePermissions = (uint)value;
9083 inv.Value.GroupPermissions = (uint)value; 9086 break;
9084 break; 9087 case 4:
9085 case 3: 9088 item.NextPermissions = (uint)value;
9086 inv.Value.EveryonePermissions = (uint)value; 9089 break;
9087 break;
9088 case 4:
9089 inv.Value.NextPermissions = (uint)value;
9090 break;
9091 }
9092 }
9093 } 9090 }
9094 } 9091 }
9095 } 9092 }