aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-07-04 21:42:04 +0100
committerJustin Clark-Casey (justincc)2012-07-04 21:42:04 +0100
commitf9fa34408dd178eb202e0cc1336da67cc0a494f0 (patch)
tree127b4041d197954a54b725a81f8429132ca54393 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation
parentrefactor: In llRemoteLoadScriptPin() use existing GetInventoryItem() (diff)
downloadopensim-SC-f9fa34408dd178eb202e0cc1336da67cc0a494f0.zip
opensim-SC-f9fa34408dd178eb202e0cc1336da67cc0a494f0.tar.gz
opensim-SC-f9fa34408dd178eb202e0cc1336da67cc0a494f0.tar.bz2
opensim-SC-f9fa34408dd178eb202e0cc1336da67cc0a494f0.tar.xz
refactor: in llGetInventoryPermMask use existing GetInventoryItem()
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs42
1 files changed, 19 insertions, 23 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index a1620e7..a173d64 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -6644,7 +6644,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6644 public void llRemoteLoadScriptPin(string target, string name, int pin, int running, int start_param) 6644 public void llRemoteLoadScriptPin(string target, string name, int pin, int running, int start_param)
6645 { 6645 {
6646 m_host.AddScriptLPS(1); 6646 m_host.AddScriptLPS(1);
6647 6647
6648 UUID destId = UUID.Zero; 6648 UUID destId = UUID.Zero;
6649 6649
6650 if (!UUID.TryParse(target, out destId)) 6650 if (!UUID.TryParse(target, out destId))
@@ -9032,31 +9032,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9032 } 9032 }
9033 } 9033 }
9034 9034
9035 public LSL_Integer llGetInventoryPermMask(string item, int mask) 9035 public LSL_Integer llGetInventoryPermMask(string itemName, int mask)
9036 { 9036 {
9037 m_host.AddScriptLPS(1); 9037 m_host.AddScriptLPS(1);
9038 9038
9039 lock (m_host.TaskInventory) 9039 TaskInventoryItem item = m_host.Inventory.GetInventoryItem(itemName);
9040 { 9040
9041 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory) 9041 if (item == null)
9042 { 9042 return -1;
9043 if (inv.Value.Name == item) 9043
9044 { 9044 switch (mask)
9045 switch (mask) 9045 {
9046 { 9046 case 0:
9047 case 0: 9047 return (int)item.BasePermissions;
9048 return (int)inv.Value.BasePermissions; 9048 case 1:
9049 case 1: 9049 return (int)item.CurrentPermissions;
9050 return (int)inv.Value.CurrentPermissions; 9050 case 2:
9051 case 2: 9051 return (int)item.GroupPermissions;
9052 return (int)inv.Value.GroupPermissions; 9052 case 3:
9053 case 3: 9053 return (int)item.EveryonePermissions;
9054 return (int)inv.Value.EveryonePermissions; 9054 case 4:
9055 case 4: 9055 return (int)item.NextPermissions;
9056 return (int)inv.Value.NextPermissions;
9057 }
9058 }
9059 }
9060 } 9056 }
9061 9057
9062 return -1; 9058 return -1;