refactor: in llGetInventoryPermMask use existing GetInventoryItem()
parent
857494f6bd
commit
f9fa34408d
|
@ -9032,31 +9032,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
}
|
||||
}
|
||||
|
||||
public LSL_Integer llGetInventoryPermMask(string item, int mask)
|
||||
public LSL_Integer llGetInventoryPermMask(string itemName, int mask)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
lock (m_host.TaskInventory)
|
||||
{
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||
{
|
||||
if (inv.Value.Name == item)
|
||||
{
|
||||
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(itemName);
|
||||
|
||||
if (item == null)
|
||||
return -1;
|
||||
|
||||
switch (mask)
|
||||
{
|
||||
case 0:
|
||||
return (int)inv.Value.BasePermissions;
|
||||
return (int)item.BasePermissions;
|
||||
case 1:
|
||||
return (int)inv.Value.CurrentPermissions;
|
||||
return (int)item.CurrentPermissions;
|
||||
case 2:
|
||||
return (int)inv.Value.GroupPermissions;
|
||||
return (int)item.GroupPermissions;
|
||||
case 3:
|
||||
return (int)inv.Value.EveryonePermissions;
|
||||
return (int)item.EveryonePermissions;
|
||||
case 4:
|
||||
return (int)inv.Value.NextPermissions;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (int)item.NextPermissions;
|
||||
}
|
||||
|
||||
return -1;
|
||||
|
|
Loading…
Reference in New Issue