add LSL_Key osGetInventoryLastOwner(string itemNameorid)

0.9.1.0-post-fixes
UbitUmarov 2019-02-21 21:56:27 +00:00
parent 17ea412da1
commit 16596b6ad0
3 changed files with 26 additions and 2 deletions

View File

@ -4874,8 +4874,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return Math.Atan2(mcross, dot);
}
//******* link sound
public void osAdjustSoundVolume(LSL_Integer linknum, LSL_Float volume)
{
m_host.AddScriptLPS(1);
@ -5406,5 +5404,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return 1;
}
public LSL_Key osGetInventoryLastOwner(string itemNameorid)
{
m_host.AddScriptLPS(1);
TaskInventoryItem item = null;
UUID itemID;
if (UUID.TryParse(itemNameorid, out itemID))
item = m_host.Inventory.GetInventoryItem(itemID);
else
item = m_host.Inventory.GetInventoryItem(itemNameorid);
if (item == null)
return UUID.Zero.ToString();
UUID id = item.LastOwnerID;
if(id == UUID.Zero)
id= item.OwnerID;
return id.ToString();
}
}
}

View File

@ -547,5 +547,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_Integer osApproxEquals(vector va, vector vb, LSL_Float margin);
LSL_Integer osApproxEquals(rotation ra, rotation rb);
LSL_Integer osApproxEquals(rotation ra, rotation rb, LSL_Float margin);
LSL_Key osGetInventoryLastOwner(string itemNameOrId);
}
}

View File

@ -1366,5 +1366,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
return m_OSSL_Functions.osApproxEquals(ra, rb, margin);
}
public LSL_Key osGetInventoryLastOwner(string itemNameOrId)
{
return m_OSSL_Functions.osGetInventoryLastOwner(itemNameOrId);
}
}
}